You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jacob Kjome <ho...@visi.com> on 2003/06/01 17:56:45 UTC
how to glob copy from sample.file.txt to an empty file.txt?
I currently have a glob copy that looks like this...
<copy todir="${basedir}" >
<fileset dir="${basedir}">
<present present="srconly" targetdir="${basedir}">
<mapper type="glob" from="sample.*" to="*" />
</present>
</fileset>
<mapper type="glob" from="sample.*" to="*" />
</copy>
That copies any sample.* to * if, and only if, * does not already exist.
What I'd like to do for certain files is empty the contents of the file
when sample.* is copied to *. Basically, I want an empty * file that
corresponds to the, full of content, sample.* file. Is there any way to
do that? I can't seem to think of one without resorting to scripting?
Jake
Re: how to glob copy from sample.file.txt to an empty file.txt?
Posted by Antoine Levy-Lambert <le...@tiscali-dsl.de>.
One solution would be that you nest a filterchain in your copy operation,
and that you write a custom filter which would be producing no output at
all, thus generating an empty file.
Antoine
----- Original Message -----
From: "Jacob Kjome" <ho...@visi.com>
To: <us...@ant.apache.org>
Sent: Sunday, June 01, 2003 5:56 PM
Subject: how to glob copy from sample.file.txt to an empty file.txt?
>
> I currently have a glob copy that looks like this...
>
> <copy todir="${basedir}" >
> <fileset dir="${basedir}">
> <present present="srconly" targetdir="${basedir}">
> <mapper type="glob" from="sample.*" to="*" />
> </present>
> </fileset>
> <mapper type="glob" from="sample.*" to="*" />
> </copy>
>
> That copies any sample.* to * if, and only if, * does not already exist.
>
> What I'd like to do for certain files is empty the contents of the file
> when sample.* is copied to *. Basically, I want an empty * file that
> corresponds to the, full of content, sample.* file. Is there any way to
> do that? I can't seem to think of one without resorting to scripting?
>
> Jake
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>