thanks a tonne .. that's the nicest way 'cause my build.xml is not longer dependent on these often changing o/p files .. i was trying to do something like this Get a list of subdirectiories Say my base directory is /ci ..and it has folders like /ci/RL_1_5_9 , /ci/RL_1_5_10 , /ci/RL_1_5_11 and inturn under folder RL_1_5_9 i have 2007_15030945 basically i have to go through status.txt present in these directories.. /ci/RL_1_5_9/2007_15030945, /ci/RL_1_5_9/2007_15031000 and if the status.txt has a string "FAIL" then I have to delete 2007_15030945,2007_15031000 directories. Is there a cleaner way to do this in ANT or should I rely on the not so nice way of having java scripts in my build.xml
-Shankar On 3/15/07, Matt Benson <[EMAIL PROTECTED]> wrote:
--- [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]