ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <>
Subject RE: <replaceregexp> to wipe out everything in a file
Date Fri, 18 Jun 2004 17:45:56 GMT
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=",">
    <fileset id="set" dir="${dir}" 
             includes="**/*.log" />
  <map from="${dir}" to="" />

<wipe dir="${dir}" files="${files}" />

<macrodef name="wipe">
  <attribute name="dir" />
  <attribute name="files" />
      <fileset dir="@{dir}" includes="@{files}" />
      <filelist dir="@{dir}" files="@{files}" />

If/when we get <local> properties you could
encapsulate the whole thing in a <macrodef> and THAT
would be slick...


Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.

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

View raw message