ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jful...@ruminate.co.uk
Subject RE: Find - is there parallel ant task?
Date Wed, 14 Sep 2005 07:53:13 GMT
"Barak Yaish" <byaish@cloverleafcomm.com> wrote ..
> Perhaps I'm not clear enough, so I'll attach an example.
> 
> Lets say there is files A, B, C, D. I would like to select from {B, C,
> D} only the files that are newer than file A. For this purpose I guess
> I should extract the timestamp of A and then use in the date selector.
> My first question is: how can I extract the timestamp of A in order to
> use later in the date selector?

u have answered u're own question here;

> My second question is: is there more straightforward way to achieve my
> goal?

as an alternate u could iterate through a fileset (use ant-contrib <for> task, which
can take a <fileset>, that iterates through each file) testing a condition each time
(http://ant.apache.org/manual/CoreTasks/condition.html), that is setting a property if file
X datestamp is newer then file A....once again u could use ant-contrib <if> to achieve
this.

another way to build up a fileset is to manipulate in another language, for example you could
have a bit of javascript that does this checking, which builds up a fileset.

gl and post your solution back for the list, Jim Fuller
> 
> -----Original Message-----
> From: jfuller@ruminate.co.uk [mailto:jfuller@ruminate.co.uk]
> Sent: ?? 14 ?????? 2005 10:28?
> To: Ant Users List
> Cc: Ant Users List
> Subject: RE: Find - is there parallel ant task?
> 
> "Barak Yaish" <byaish@cloverleafcomm.com> wrote ..
> > I'm appreciating the useful answer - I'm doing my very first steps with
> > ant and not aware yet to all its features, so questions I cannot answer
> > using google or ant site, I'm directing to the list.
> >
> > Your suggestion is work, of course. Now I'm looking for a way to find
> a
> > set of files, which are newer than a certain file (sometimes an hard
> coded
> > timestamp is not available in my project). As I saw in Date selector,
> the
> > comparison is based on hard coded timestamp, millis, etc. Can you, please,
> > suggest a way to define a fileset newer than a certain file?
> 
> What other way is there to know if a file is 'newer' other then comparing
> file timestamps? perhaps u also want to know if there is a delta between
> files? Ant has many selectors for refining how to 'select' a file.
> 
> Perhaps u are looking for something a bit more procedural, I would suggest
> checking out the <outofdate/> task contained in the useful ant-contrib
> lib
> 
> http://ant-contrib.sourceforge.net/tasks/tasks/index.html
> 
> otherwise what u want is achievable, as prev mentioned with selectors (which
> creates the fileset that can be used by other tasks), and if u need to
> print it out use pathconvert.
> 
> gl, Jim Fuller
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message