ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: available does not support *
Date Tue, 05 Sep 2006 05:45:34 GMT
<project>
    <property name="pattern" value="*.xml"/>

    <pathconvert property="available" setonempty="false">
        <fileset dir="." includes="${pattern}"/>
    </pathconvert>

    <fail message="No files found" unless="available"/>

</project>


<available> does not support patterns, but <fileset> does. So the trick is
to use that and set a property (to some irrelevant value) if (and only if)
the fileset catched files.

Jan 

>-----Urspr√ľngliche Nachricht-----
>Von: Dirk Starke [mailto:dirk@starke-net.de] 
>Gesendet: Dienstag, 5. September 2006 07:31
>An: user@ant.apache.org
>Betreff: available does not support *
>
>Hello guys,
>
>I would like to test whether or not a specified directory 
>contains some files. 'Cause I do not really (want to) know 
>what their names are, I tried
>
>  <*available* file="*" ...
>
>but that did not work. Obviously the *available*-task does not 
>like patterns.
>Has anybody an idea how I could get this working?
>Thanks a lot in advance.
>
>Regards,
>Dirk
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
>additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message