-----Original Message-----
From: cvsusr [mailto:[email protected]]
Sent: Thursday, October 29, 2009 3:34 PM
To: [email protected]
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: [email protected]
For additional commands, e-mail: [email protected]