ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Dallaway <rich...@dallaway.com>
Subject Delete all but the most recent N files
Date Wed, 09 Oct 2002 21:06:04 GMT
I'm looking for a task that will allow me to delete a set of files, 
except for the last N (say, the last 5 most recently modified files).

Specifically, the application I work on is built automatically (using 
Cruse Control), and I'd like to keep just the last N .jar files that it 
constructs -- rather than have to remember to go and clean up the 
directory when the disk fills :-(.

I guess I could do this with a cron job/scheduled task, or I could shell 
out, but I think it would be neater as a task.  I'm very happy to go and 
write a custom task, but I'd rather not if there's a clever way to do 
this using the core or optionals tasks.

Many thanks
Richard



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


Mime
View raw message