ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nissea <>
Subject Suppress echo of targetname
Date Thu, 15 Nov 2007 11:12:34 GMT


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"> 
      <fileset dir="C:\TEMP" casesensitive="no" />

<target name="deleteHash" >
  <if><contains string="${Files}" substring="hash" />
      <delete file="${Files}" />

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.

View this message in context:
Sent from the Ant - Users mailing list archive at

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

View raw message