ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: Task to count files in a fileset?
Date Sun, 26 Mar 2006 18:50:42 GMT
--- Rick Genter <rgenter@silverlink.com> wrote:

> Fellow ant-users,
> 
> Is there a way using only core tasks in ant 1.6.5 to
> count the number of
> files in a fileset? I've been through the manual and
> nothing leapt out
> at me. Thanks.

Hi Rick.  In Ant 1.7 you will be able to use the
<resourcecount> task/condition.  For now, in Ant
1.6.5, I'm afraid there is no solution... just
kidding; actually here is a trick you can use.  >;)

Use <pathconvert> to convert your filelist to a
property.  Use a merge mapper to call each file "*" or
whatever.  Set whatever the attribute is that makes
pathconvert still create the property even if the
result is empty (setonempty="true"?).  Now use the
<length> task/condition (available in Ant >= 1.6.3
IIRC), against your newly-<pathconvert>ed property.

HTH,
Matt

> 
> Rick
> --
> Rick Genter
> Principal Engineer
> Silverlink Communications
> <mailto:rgenter@silverlink.com>
> (781) 425-5763
> 
>
---------------------------------------------------------------------
> 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


Mime
View raw message