ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Checking existence of folders with a particular naming convention | Need Help
Date Fri, 24 Aug 2007 11:07:26 GMT
Simply use

<pathconvert>
   <path>
       <fileset>


Jan 

>-----Urspr√ľngliche Nachricht-----
>Von: Utpal Sen [mailto:shinjan.sen@gmail.com] 
>Gesendet: Freitag, 24. August 2007 12:59
>An: Ant Developers List
>Betreff: Re: Checking existence of folders with a particular 
>naming convention | Need Help
>
>Hi,
>Many thanks for the mail.
>However in the verison of ant (1.6.5) I am using <fileset> was 
>not allowed
>to be an nested property of <pathconvert>
>
>so what I did was declared an refid for fileset and added that to
>pathconvert:
><project>
><target name="clean">
>    <property name="pattern" value="utpal*"/>
>    <fileset dir="." id="file.name" includes="${pattern}"/>
>    <pathconvert property="available" setonempty="false" 
>refid="file.name"/>
></target>
><target name="doc" depends="clean" unless="available">
>        <echo>folder exists</echo>
></target>
></project>
>
>Many thanks for your suggestion. It worked.
>
>Regards,
>Utpal
>
>
>
>On 8/24/07, Jan.Materne@rzf.fin-nrw.de 
><Jan.Materne@rzf.fin-nrw.de> wrote:
>>
>> see http://marc.info/?l=ant-user&m=115743516213282&w=2
>>
>> Jan
>>
>>
>> >-----Urspr√ľngliche Nachricht-----
>> >Von: Utpal Sen [mailto:shinjan.sen@gmail.com]
>> >Gesendet: Freitag, 24. August 2007 11:45
>> >An: dev@ant.apache.org
>> >Betreff: Checking existence of folders with a particular
>> >naming convention | Need Help
>> >
>> >Hi,
>> >I wanted to check for the existence of folders having a fixed
>> >pattern as
>> >part of their name.
>> >I checked the <available> task but here I cannot pass a
>> >regular expression
>> >or wildcard character in the attribute 'file'.
>> >
>> >Following is my code (which is not working):
>> >
>> ><project>
>> ><target name="clean">
>> ><available property="isadir"
>> >                   file="*utpal_***"
>> >                type="dir"/>
>> ></target>
>> ><target name="doc" depends="clean" if="isadir">
>> >        <echo>folder exists</echo>
>> ></target>
>> ></project>
>> >
>> >I have folders named utpal_004500 and utpal_004600. I want to
>> >check if any
>> >folder that starts with the name utpal_ exists.
>> >Kindly let me know how I can achieve this.
>> >
>> >Thanks
>> >Utpal
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> For additional commands, e-mail: dev-help@ant.apache.org
>>
>>
>

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


Mime
View raw message