So the current solution I have finds the latest modified FILE inside all of the folders. I need a way to get the latest modified folder. The reason being, a folder will get created on a daily basis, and I will need to use that folder value in a file path so that I can copy the contents of that path in another directory.
The code I have is as follows:
<target name = "latest">
<copy todir = "H:\New">
<last>
<sort>
<date xmlns="antlib:org.apache.tools.ant.types.resources.comparators"/>
<filseset dir ="H:\test"/>
</sort>
</last>
</copy>
</target>
Folder Overview
Main
|---Folder2(16/01/15)
|---Folder1(28/01/15)
The program needs to select Folder1 (overall idea).
I.E. of file path: C:/A/${latest.modified<}/etc/files
To find a directory rather than a file, use a
<dirset>
instead of a<fileset>
, for example: