ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: <copy/> does not "preservelastmodified" on directories.
Date Tue, 18 Oct 2011 11:17:27 GMT
On 2011-10-18, Steve Amerige wrote:

> I'm wondering if the <zip> task might get you what you're looking for.
> Although, I'm baffled over the the statement that "Zip archives store
> file modification times with a granularity of two seconds."  You're
> kidding, right?  :-)

Not at all, that's the format definition.

Some implementations use extra field data to store timestamps at a
different granularity (or other time stamps like creation time or last
access time) but they are ignored in most cases.

> The <tar> task doesn't mention the 2-second granularity problem, but
> even with <tarfileset>,

TAR uses a one second granularity (seconds since midnight Jan 1st 1970,
"the epoch"), the same is true for CPIO or AR if you wanted to use the
Compress Antlib.

tar is likely faster than zip as well as it won't compress the files.

> the documentation seems to imply that it damages the modes (see the
> filemode and dirmode attributes).

Ant can not read the current file permissions (not possible without
native code pre-Java7) and thus cannot tell zip/tar what to store.

The same limitation applies to copy itself, Ant's copy task doesn't
preserve permissions either.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message