You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ninju Bohra <ni...@yahoo.com> on 2005/07/01 21:46:57 UTC
Need to know if a file is newer than a particular date
Hello all,
I have been looking around the ANT help and can not
find a concise way to do this so I thought would see
anybody has a quick way to do this:
I need to determine if a given file (I know its path
and name) is newer than a given date. I want to set a
property if the file is newer. Any quick way?
The only way I have found is would be by setting up
<filelist> on the specific file and use a
<dateselector> to filter the list by date and then
somehow setting the property if the list is empty. I
am not sure this would even work (if it would).
Thanx,
Ninju
____________________________________________________
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
http://football.fantasysports.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Need to know if a file is newer than a particular date
Posted by Matt Benson <gu...@yahoo.com>.
You're on the right track. You'll need a fileset for
the selector; supply pathconvert with this, setting
setonempty="false" and your property will remain unset
if no files match.
HTH,
Matt
--- Ninju Bohra <ni...@yahoo.com> wrote:
> Hello all,
>
> I have been looking around the ANT help and can not
> find a concise way to do this so I thought would see
> anybody has a quick way to do this:
>
> I need to determine if a given file (I know its path
> and name) is newer than a given date. I want to set
> a
> property if the file is newer. Any quick way?
>
> The only way I have found is would be by setting up
> <filelist> on the specific file and use a
> <dateselector> to filter the list by date and then
> somehow setting the property if the list is empty.
> I
> am not sure this would even work (if it would).
>
> Thanx,
>
> Ninju
>
>
>
>
>
>
> ____________________________________________________
>
> Yahoo! Sports
> Rekindle the Rivalries. Sign up for Fantasy Football
>
> http://football.fantasysports.yahoo.com
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org