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 15:56:33 GMT
hi!

my bad.  i didn't mean to mislead anyone.  i said EOF
because from my understanding, it's something all
files have.  i wanted basically 'dummy' files with
nothing at all in them.  the fact that they turned out
to be zero bytes in size was great.

could you show me how you did the <delete> and <touch>
solution?

i tried the following but the problem is the fileset
does not retain in its memory the filenames, so after
the <delete> task, all files are gone and <touch> is
working on an 'empty' fileset:

<fileset id="myfiles" dir="${mydir}"/>

<target name="test">
	<delete>
		<fileset refid="myfiles"/>
	</delete>

	<touch>
		<fileset refid="myfiles"/>
	</touch>
</target> 

if fileset can retain the filenames after <delete>
task then the above would work nicely.  also, Matt, i
tried swapping <echo> with <touch> in the above code
with the following:

<echo message="">
  <fileset refid="myfiles"/>
</echo>

but unfortunately, <echo> does not support fileset. :(

does your <delete> and <touch> solution turn every
file where they are into empty files (stay in same
physical location/path with name unchanged)?  this is
what i want to do.



--- Matt Benson <gudnabrsam@yahoo.com> wrote:
> --- Woodchuck <woodchuck_5@yahoo.com> wrote:
> > see!!  very nice suggestion!!  (i forgot about
> this
> > nice unix command touch...)
> > 
> > let me see if i can apply this <delete> & <touch>
> > strategy to my situation...
> 
> I cooked up one yesterday using <delete> and <touch>
> but let it lie since <replaceregexp flags="s">
> worked.
>  Also, your original post suggested that you did not
> actually want a zero-byte file, but a file
> consisting
> of only the DOS EOF character.  If this is the case,
> just use <fixcrlf fixlast="false" eof="add">.
> 
> -Matt
> 


		
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
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