ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <>
Subject Re: Reg:Selection of files on the basis of timestamp
Date Mon, 17 Aug 2009 15:15:37 GMT
On Mon, Aug 17, 2009 at 10:25 AM, S G <> wrote:

> Hi,
>     I have a folder which has files of different extension.
>     I have to select files on the basis of timestamp.
> For eg : 5 days old.
> How to do this?
> Thanks & Regards
> Sulabh

Have you looked at this section: <>?
This will tell you how to use <date> to select files just as you would with
<include> and <exclude> selectors.

And the <TStamp> task: <>?
The <date> selector needs an actual date. You can use <Tstamp> to calculate
the date via the "offset" attribute.

You can do something like this:

<!-- Sets for five days before -->
<Tstamp property=""

<!-- Sets for six days before -->
<Tstamp property=""

<!--Tries to select between five and six days before -->
<fileset dir="${my.dir}">
    <date datetime="${} 12:01 AM" when="before"/>
    <date datetime="${} 11:59 PM" when="after"/>

David Weintraub

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message