ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndario <dario...@yahoo.com>
Subject how to use <first>?
Date Wed, 26 Nov 2008 14:53:49 GMT

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

  <copy todir="dest" flatten="true">
    <first count="2">
      <sort>
        <date
xmlns="antlib:org.apache.tools.ant.types.resources.comparators"/>
        <resources>
          <file file="src_dir/file1.txt"/>
          <file file="src_dir/file2.txt"/>
          <file file="src_dir/file3.txt"/>
          <url url="http://ant.apache.org/index.html"/>
        </resources>
      </sort>
    </first>
  </copy>

finds latest file and copies it to the destination, but I want the oposite.
I need to determine correct destination.

Could anybody give me a hint how to use <first>, please.

Thanks
-- 
View this message in context: http://www.nabble.com/how-to-use-%3Cfirst%3E--tp20702429p20702429.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message