ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Suppress echo of targetname
Date Thu, 15 Nov 2007 11:15:39 GMT
Why not just
<delete>
  <fileset dir="C:\TEMP" includes="**/hash*"/>
</delete>

Jan

> -----Urspr√ľngliche Nachricht-----
> Von: nissea [mailto:nils.asp@ngai.se] 
> 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: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message