On 6/10/05, Sam Gardiner <[EMAIL PROTECTED]> wrote:
>
> Is there a way to create a fileset of files by date? I want to delete files
> older than a certain date and I have no good ways of doing it.
>
> cheers,
>
> sam
Sam,
It sounds like you're asking for a way to create a fileset by applying
a filter to another fileset... which sounds like an interesting and
useful task, but not one which NAnt supports at the moment (to the
best of my knowledge).
An alternative to achieve what you want (using one of the 0.85 release
candidates or a nightly) is to loop over the files in your fileset and
conditionally delete files based on the evaluation of a function:
<foreach item="File" property="file">
<in>
<items refid="my-fileset" />
</in>
<do>
<delete file="${file}" if="${file::get-last-write-time(file) <
datetime::parse(targetdate)" />
</do>
</foreach>
Regards,
--
Troy
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r
_______________________________________________
Nant-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users