You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by th...@ascentialsoftware.com on 2001/12/03 16:40:40 UTC

copy task with merge mapper bug?

I did not find any reports in the apache bug database, I was going to submit
one, but I'd like to check with you guys to make sure that this is really a
bug or if I misunderstood the way it is working.
A copy task with a fileset and a merge mapper is not producing a
concatenated file of all the source file (which is my understanding of what
the merge mapper should do). Instead, the result file specified by the merge
mapper will be equal to the last copied source file (I looked at the code,
each source file is copied as the destination file one after another,
overwriting the destination file every time) if the overwrite option is set
to true. If overwrite option is set to false, then the result file specified
by the merge mapper will be equal to the first copied source file (all the
other copy will not overwrite the first copy).

Is it the expected behavior, or is it a bug?

The following copy task:

<copy todir="." verbose="true">
  <fileset dir=".">
    <include name="file1"/>
    <include name="file2"/>
  </fileset>
  <mapper type="merge" to="result_file"/>
</copy>

result_file will be equal to file1.
If overwrite option is set to true in the copy task, result_file will be
equal to file2.
I was expecting result_file to be the concatenation of file1 and file2.

Thanks.

Thomas

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: copy task with merge mapper bug?

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 3 Dec 2001, thomas cherel
<th...@ascentialsoftware.com> wrote:

> Is it the expected behavior, or is it a bug?

It is expected behavior.  The merge mapper is used by things like the
zip task to see whether the archive is older than any file that would
be added to it, it has little value when used as a "user mapper" IMHO.

What you expecteded it to do is something that wouldn't really fit
into my picture of a copy task, more something like a new <concat>
task or similar.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>