ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject Re: Multiple directory existence checking
Date Tue, 11 May 2004 16:27:47 GMT
Dominique Devienne wrote:

>>From: Rhino []
>>I may give this a try myself but I thought I'd post this first to minimize
>>the time you have to wait for a suggestion. If I get my experiment to
>>work, I'll post the technique.
>Something along the lines of (untested):
><condition property="all there">
>  <and>
>    <available file="${root}/dir1" type="dir" />
>    <available file="${root}/dir2" type="dir" />
>    <available file="${root}/dir3" type="dir" />
>  </and>
This works fine if you know the directories.
If you do not (directories are in a property), you need to
use something like the ant-contrib for task:
<project xmlns:ac="antlib:net.sf.antcontrib">
  <property name="root" location="src"/>
  <property name="subdirs" value="a:b:c:d"/>
  <target name="check.allpresent">
    <ac:for list="${subdirs}" delimiter=":" param="dir">
          <condition property="not.all.there">
               <available file="${root}/@{dir}" type="dir"/>
  <target name="dothetask" depends="check.allpresent" 


>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message