ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: fileset date selector based on the date of a file
Date Thu, 19 Jul 2007 15:40:45 GMT
Just for discussion's sake, this can also be solved
with some of the resource stuff introduced in Ant 1.7:

<restrict id="newer">
  <compare
xmlns="antlib:org.apache.tools.ant.types.resources.selectors"
when="gt">
    <control><file file="reference_file" /></control>
    <date
xmlns="antlib:org.apache.tools.ant.types.resources.comparators"
/>
  </compare>
  <fileset refid="candidate_files" />
</restrict>

... you should now have a resource collection at refid
"newer" consisting only of those members of
candidate_files that are newer than reference_file.

FWIW,
Matt

--- Dominique Devienne <ddevienne@gmail.com> wrote:

> You can use <uptodate> to select the newer files.
> 
> Or Ant-Contrib's <outofdate>, which I find more
> convenient, since
> avoids having multiple targets, but it adds a
> dependency. --DD
> 
> On 7/19/07, Wayne Cannon <wcannon@turinnetworks.com>
> wrote:
> > I would like to do the equivalent of a "find
> -newer reference_file ... |
> > zip ... ", i.e., archiving all files newer than a
> reference_file.  I
> > would like to archive only the files that have
> changed since the last
> > major archive into a smaller, faster, "delta"
> archive; much like an
> > incremental backup works.
> >
> > The <date> selector in a <fileset> looks like the
> logical solution, but
> > it appears to only use a date-time string and not
> a reference file to
> > specify the date.
> >
> > Is there a way to use the date-time of a reference
> file, instead of a
> > string, for the <date> selector?
> > Is there a way to set a property with the
> date-time of a reference file
> > so that the property can be passed to a <date>
> selector?
> > Is there another way to accomplish my goal, such
> as a way to use
> > <depend> with a single reference file?
> >
> > --Wayne
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> user-help@ant.apache.org
> >
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



       
____________________________________________________________________________________
Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.com/collections/222

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


Mime
View raw message