ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Woodchuck <woodchuc...@yahoo.com>
Subject RE: <replaceregexp> to wipe out everything in a file
Date Fri, 18 Jun 2004 18:01:39 GMT
wow, i need some time to study your solution.

but thanks!  i've never used those ant tasks yet, but
it's very interesting!

yea, if <local> will be available (for us to use as
local variables in ant tasks) that would be great.


--- Matt Benson <gudnabrsam@yahoo.com> wrote:
> Basically, using <touch> after <delete> to create
> empty files necessitates knowing the name of every
> file.  If you don't know these in advance you could
> do
> something like this:
> 
> <property name="dir" location="wipe" />
> 
> <pathconvert property="files" pathsep=",">
>   <path>
>     <fileset id="set" dir="${dir}" 
>              includes="**/*.log" />
>   </path>
>   <map from="${dir}" to="" />
> </pathconvert>
> 
> <wipe dir="${dir}" files="${files}" />
> 
> <macrodef name="wipe">
>   <attribute name="dir" />
>   <attribute name="files" />
>   <sequential>
>     <delete>
>       <fileset dir="@{dir}" includes="@{files}" />
>     </delete>
>     <touch>
>       <filelist dir="@{dir}" files="@{files}" />
>     </touch>
>   </sequential>
> </macrodef>
> 
> If/when we get <local> properties you could
> encapsulate the whole thing in a <macrodef> and THAT
> would be slick...
> 
> -Matt
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - You care about security. So do we.
> http://promotions.yahoo.com/new_mail
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

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


Mime
View raw message