--- Begin Message ---
Subject: |
Re: bug#9277: cp |
Date: |
Wed, 10 Aug 2011 13:09:52 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11 |
On 08/10/2011 12:40 PM, vesselin kavalov wrote:
cp -a src/{a,b,c} dest does NOT preserve the time stamp on symbolic links.
Thanks for the report, but you are missing some details. What version
of coreutils? What operating system? And assuming Linux, what kernel
version?
Be aware that symlink timestamp preservation requires the use of
futimens or utimensat, which were only recently standardized by POSIX
2008, and which are lacking on a lot of older systems; plus, being new
interfaces, they require newer coreutils that actually takes advantage
of the newer interfaces. Also be aware that symlink timestamps are
worthless - there's generally not much you can usefully do with them,
whether or not you have the flexibility of modifying them.
At any rate, things work for me, using kernel 2.6.35 and coreutils 8.5
(the defaults of Fedora 14):
$ ln -s a b
$ sleep 20
$ cp -a b c
$ stat b c
File: `b' -> `a'
Size: 1 Blocks: 0 IO Block: 4096 symbolic link
Device: fd02h/64770d Inode: 266785 Links: 1
Access: (0777/lrwxrwxrwx) Uid: (14986/ eblake) Gid: (14986/ eblake)
Access: 2011-08-10 13:04:42.420640012 -0600
Modify: 2011-08-10 13:04:34.308611690 -0600
Change: 2011-08-10 13:04:34.308611690 -0600
File: `c' -> `a'
Size: 1 Blocks: 0 IO Block: 4096 symbolic link
Device: fd02h/64770d Inode: 304795 Links: 1
Access: (0777/lrwxrwxrwx) Uid: (14986/ eblake) Gid: (14986/ eblake)
Access: 2011-08-10 13:04:59.771700484 -0600
Modify: 2011-08-10 13:04:34.308611690 -0600
Change: 2011-08-10 13:04:57.174691438 -0600
Note that atime and mtime were indeed preserved. Therefore, I'm closing
this bug unless you can provide more details about any bugs still remaining.
I understand that neither does 'tar' , but that probably is a fault, not a
feature there either.
Wrong again. The latest tar, coupled with the latest kernel, does
support symlink timestamps.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
--- End Message ---