ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Dallaway <>
Subject Re: Delete all but the most recent N files
Date Tue, 15 Oct 2002 10:45:20 GMT

Thanks for the feedback.   It does work on directories, in that if you 

  <purge keep="5">
	<fileset dir="/foo" />

...then it will (should!) search and consider all sub folders of "foo". 
  E.g., /foo/baz/logs/file.txt would be a file considered for purging.

However, what it doesn't do is delete directories.  For the way I work, 
it'd be a pain for "log" fodlers to start being removed.  Then again, if 
  directory deletion is something you need, I think it'd be simple to 
add it as a flag.


David Colton (ext. 799) wrote:
> Richard.
> Congrats on a developing a very useful task. I'll be hitting this problem
> soon when I set up a continuous build.
> Have you tried using this \ would this work on directories. We also build
> nightly and every now and then a build fails when the disk in full.
> If it doesn't work on directories it would be nice if it did. I don't have
> time at the moment myself to look into this but will get to it eventually.
> If I do need to make changes to get it working with directories I'll send
> you any updates.
> Dave.
> -----Original Message-----
> From: Richard Dallaway []
> Sent: 15 October 2002 11:03
> To: Ant Users List
> Subject: Re: Delete all but the most recent N files
> Just wanted to thank every one who chipped in with ideas for solving 
> this problem.  It was a huge help in digging around Ant trying to find a 
> good way to "purge" old files.
> In the end, I've build a task to do the job.  It's available here:
> Comments, bug reports, suggestions... always welcome.
> If we find related uses for the components of this task, then maybe that 
> would be a good time to think about refactoring it into something more 
> generic.
> Thanks again
> Richard

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message