Why not just <delete> <fileset dir="C:\TEMP" includes="**/hash*"/> </delete>
Jan > -----Ursprüngliche Nachricht----- > Von: nissea [mailto:[EMAIL PROTECTED] > Gesendet: Donnerstag, 15. November 2007 12:13 > An: user@ant.apache.org > Betreff: Suppress echo of targetname > > > Hi > > I would like to check all files in a directory and if the > filename starts > with "hash" the file should be removed. > My code looks like this: > > <target name="delete" > > <foreach target="deleteHash" param="Files" inheritall="true"> > <path> > <fileset dir="C:\TEMP" casesensitive="no" /> > </path> > </foreach> > </target> > > <target name="deleteHash" > > <if><contains string="${Files}" substring="hash" /> > <then> > <delete file="${Files}" /> > </then> > <else/> > </if> > </target> > > The target "delete" calls the target "deleteHash" for every > file that are in > the directory "C:\TEMP". So if I have for example 1000 files in that > directory it will echo out "deleteHash:" 1000 times even if > it's only one > file that starts with "hash". So I would like to remove the echo > "deleteHash:" or make some solution so I first check if the > filename starts > with "hash" and if so call target "deleteHash". Any > suggestions or help are > very appreciated, thanks. > > //Nisse > -- > View this message in context: > http://www.nabble.com/Suppress-echo-of-targetname-tf4811207.ht > ml#a13765770 > Sent from the Ant - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]