bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cp -p loses precision on the timestamp of the copy


From: Eric Blake
Subject: Re: cp -p loses precision on the timestamp of the copy
Date: Thu, 31 Jan 2008 20:00:46 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ray Liere on 1/31/2008 7:53 PM:
| Consider the following use of cp -p to create an identical copy (identical
| in content and in timestamps, etc.):
|
| # echo xxx > jnk
| # ls --full-time jnk
| -rw-------  1 root root 4 2008-01-31 18:40:27.879358240 -0800 jnk
| # cp -p jnk jnkcopy
| # ls --full-time jnk*
| -rw-------  1 root root 4 2008-01-31 18:40:27.879358240 -0800 jnk
| -rw-------  1 root root 4 2008-01-31 18:40:27.879358000 -0800 jnkcopy

Thanks for the report.  However...

| # ls --version
| ls (coreutils) 5.2.1

That release is VERY old, and many bug-fixes have been made in the
meantime.  The latest stable version is 6.10.  Furthermore, coreutils
suffers from the fact that until very recently, there has been no
standardized way of setting nanosecond file resolutions.  The next version
of POSIX is adding futimensat, but most OS's have not implemented it yet.
~ Therefore, if the OS provides no method for finer granularity, coreutils
has no choice but to truncate the timestamp, so this is likely not a bug
in cp.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHootd84KuGfSFAYARAs25AKDDlmWWJerDxjK60Wn7p/z8bJcgoQCeKTGq
3LxLdrH6SMR++hYSC6DGqJE=
=DeRX
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]