-----Original Message-----
From: ndario [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2008 3:54 PM
To: [email protected]
Subject: how to use <first>?

/*
Hello,

I want to copy a set of files to a directory which is dynamically generated.
I know only a part of name of that directory, it looks like this "tmp*abc":

tmp24235abc
tmp76957abc
tmp556abc
tmp6344abc


I need to copy files to a directory which has latest creation date. I guess
it would be possible with <sort> and <first> elements but I have no idea how
to use it? This example

*/

if you're able to use antcontrib, you use the timestampselector like that =

<timestampselector property="most.recent.dir" count="1">
  <path>
    <dirset dir="Y:/">
      <include name="tmp*" />
    </dirset>
  </path>
</timestampselector>

<echo>$${most.recent.dir} = ${most.recent.dir}</echo>


and the most.recent.dir property has the directory
you're are searching for.

Don't know if there's an alternative with ant 1.7.1, as i still
use ant 1.6.5 and still had no time to explore the new features.


Regards, Gilbert


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to