ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaco de Groot <jaco.de.gr...@eo.nl>
Subject Last modified of copied files
Date Mon, 09 Oct 2000 10:07:05 GMT
Hi,

I'm using ant to merge two directory's. I have two source directory's and one
destination directory. If two the same files are found in the two source
directory's I want to have the newest of the two in de destination directory. I
use:

<copydir src="source1" dest="destination" />
<copydir src="source2" dest="destination" />

The problem with this is that the copied files last modified time is the time of
copying. So the files in source2 will never be copied to the destination because
the time of the files in the destination are allways newer.

I solved this by adding the following code to Project.java on line 656:

destFile.setLastModified(sourceFile.lastModified());

I'm affraid this isn't Java 1.1 compatible, is this a problem?

If the code is changed to make the last modified time the same as the file wich
is copied, this should also be done for directory's I think.

Jaco

Mime
View raw message