--- [EMAIL PROTECTED] wrote: > Just an idea ... > > <property name="includes" > value="these;files;must;be;present"/> > <property name="includes.length" value="5"/> > <property name="dir" value="dir"/> > > <condition propery="all-files-present"> > <length length="${includes.length}"> > <fileset id="fs" dir="${dir}" > includes="${includes}"/> > </length> > </condition> >
Of course by now Jan has realized that <resourcecount> was the condition to use rather than <length>. ;) Other thoughts: if your list was e.g. 50 files as you mentioned, especially if you think that list (I believe you mentioned the idea of maintaining the list in an external file) might change oftener than you'd like to be modifying your Ant file, you might want to make your Ant file be independent of the number of files. This is slightly problematical, but if you can make the blanket assumption that your includesfile contains no wildcards it's not too bad. One example assuming that ${basedir} contains an includesfile, named includesfile: <resourcecount property="expectedfiles"> <tokens> <file file="includesfile" /> </tokens> </resourcecount> <fail> <condition> <resourcecount when="ne" count="${expectedfiles}"> <fileset dir="yourdir" includesfile="includesfile" /> </resourcecount> </condition> </fail> HTH, Matt > > > Jan > > >-----Ursprüngliche Nachricht----- > >Von: Shankar S [mailto:[EMAIL PROTECTED] > >Gesendet: Mittwoch, 14. März 2007 01:59 > >An: user@ant.apache.org > >Betreff: Checking for files in a directory > > > >Hi, > > > >Is there a way in ANT where I could check if a list > of files is > >available/present in a directory instead of having > a long list of > ><available>s under <condition>? > >Any help will be much appreciated. > > > >-Shankar > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > ____________________________________________________________________________________ Need Mail bonding? Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. http://answers.yahoo.com/dir/?link=list&sid=396546091 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]