I want to copy the newest file that is on a mapped network directory. I already have the network directory mapped to ${drive.letter}
using NET USE
.
<copy todir="${dest.dir}" overwrite="true">
<first>
<sort>
<fileset dir="${drive.letter}\">
<filename name="FileIWant-*.tar.gz" />
</fileset>
<date xmlns="antlib:org.apache.tools.ant.types.resources.comparators"/>
</sort>
</first>
</copy>
It takes an incredibly long time for this task to complete and am wondering why it takes so long and if I can speed it up. The network directory has 20K+ files in it. Does the sort task run first, then the fileset selector? Or is it just going to take awhile since it is going over the network?
The only other solution I can think of it to copy all FileIWant-*.tar.gz
files locally then perform the sort but I am unsure if the copy will change the timestamp.