ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cvsusr <sp...@rediffmail.com>
Subject RE: Alternative for <available> taks to check a pattern of file existence
Date Thu, 29 Oct 2009 15:16:04 GMT

Hi Gilbert,

Thanks..

I replace the code with this.. its working fine..


Thanks for correcting me..

Regards
Sri

Rebhan, Gilbert wrote:
> 
>  
> 
> -----Original Message-----
> From: cvsusr [mailto:spers@rediffmail.com] 
> Sent: Thursday, October 29, 2009 3:34 PM
> To: user@ant.apache.org
> Subject: Re: Alternative for <available> taks to check a pattern of file
> existence
> 
> /*
> <target name="check-abc">
> <for param="file">
>   <path>
>     <fileset id="file.exist" dir="." includes="*.txt"/>
>   </path>
> <sequential>
> <echo> file list::: @{file} </echo>
> <available file="@{file}" property="abc.present"/>
> </sequential>
> </for>
> </target>
> */
> 
> using for - which requires antcontrib also - when all you want
> to know is whether there are any files with a specific extension
> or name is redundant; all you need is a fileset and a condition
> 
> <fileset dir="your/path" includes="**/*.txt" id="checkdir"/>
> 
> <target name="check-abc">
> <condition property="abc-present">
>   <not>
>     <equals arg1="${toString:checkdir}" arg2="" />
>   </not>
> </condition>
> </target>
> 
> <target name="do-if-abc" depends="check-abc" if="abc.present">
> <echo> true</echo>
> </target>
> 
> 
> Regards, Gilbert
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Alternative-for-%3Cavailable%3E-taks-to-check-a-pattern-of-file-existence-tp26110901p26115006.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Mime
View raw message