You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Diane Holt <ho...@yahoo.com> on 2000/09/25 18:01:20 UTC

Re: File modification dates

--- Peter Donald <do...@mad.scientist.com> wrote:
> At 10:17  25/9/00 +0100, you wrote:
> >I am using the <copydir /> task to copy files from one directory to
> >another.
> >Is there anyway to have it maintain the original modification dates for
> >the copied files?
> 
> Unfortunately it is not possible in java and thus not possible in ant
> :(.
> You can do renames which I think keep original OS specific details but
> no provision is made for copy.

Couldn't you add a "preserve" attribute? Then add:
  if(preserve) destFile.setLastModified(srcFile.lastModified())
(or something close to it, if that's not exactly right) to Copyfile.java?

Diane


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

Re: File modification dates

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "DH" == Diane Holt <ho...@yahoo.com> writes:

 DH> --- Peter Donald <do...@mad.scientist.com> wrote:

 >> Unfortunately it is not possible in java

 DH> destFile.setLastModified(srcFile.lastModified())

The problem Pete is talking about is that Java 1.1 doesn't know
File.setLastModified - and Ant wants to work for Java 1.1 as well.

Glenn has already said he wants to include an attribute in the
consolidated tasks which would be ignored (including a warning I hope)
if running on JDK 1.1.

Stefan