ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guntis Ozols <gunt...@latnet.lv>
Subject Re: Enhance move, copy with @overwrite-if-filesmatch = false
Date Fri, 16 Mar 2007 13:19:28 GMT
Guntis Ozols wrote:
> > I think move and copy tasks should be enhanced with
> > overwrite-if-filesmatch boolean attribute.
> > If set to false and source and target files match,
> > target file modification time should be left unchanged.
> > This way, long rebuilds triggered by small files can be avoided.
> >
> > What do you think? Will somebody else need it, not just me?
> > I can implement this.

Steve Loughran wrote:
> I'd file this under WORKSFORME.
> If you actually want a byte-for-byte comparision, copy a <fileset> with
> a nested <different> selector. Note that this gets very slow when there
> are lots of files to copy that havent changed, because ant still has to
> read every single byte to make sure.

This attribute BELONGS to copy.
It represents the most basic relation between files.
Yes, I actually want byte-for-byte comparison, reasons above.
Please compare:

    <move overwrite-if-filesmatch="false"
          file="long-dirname/long-filename-latest.xml"
        tofile="long-dirname/long-filename.xml"/>

with (tested on 1.7):

    <copy todir="long-dirname">
      <fileset file="long-dirname/long-filename-latest.xml">
        <different targetdir="long-dirname">
          <mapper type="glob" from="*-latest.xml" to="*.xml"/>
        </different>
      </fileset>
      <globmapper from="*-latest.xml" to="*.xml"/>
    </copy>
    <delete file="long-dirname/long-filename-latest.xml"/>




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


Mime
View raw message