Ant Purge Task

The purge tasks works with Ant to remove all but the most recent few files from a fileset. For example: let's say you're
using an automated build tool, such as Cruise Control, which generates files (logs?) each time it's run.
You can use the purge task to keep just the most recent few files --- rather than allowing the directory to
fill with old files.

This task has been built against JDK 1.4 with Ant 1.4.1 and tested with Ant 1.4.1 and 1.5.1.

This would delete all but the most recent five files from
the "logs" folder. However, as the test attribute is true it
will actually just reports on the files it would have deleted.
Remove the test attribute (or set it false) to really delete
the files.

Note that folders are not deleted by this task.

If you have more than one fileset, each fileset is purged
individually. This is described in the next example.