To work properly for directories, you may want to extend your task to take a
<dirset> in addition to a <fileset>. Thanks, --DD

-----Original Message-----
From: Richard Dallaway [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, October 15, 2002 5:45 AM
To: Ant Users List
Subject: Re: Delete all but the most recent N files

Dave

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

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

...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.

Cheers
Richard

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 [mailto:[EMAIL PROTECTED]]
> 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:
> 
> http://www.dallaway.com/ant/
> 
> 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:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to