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: Ray Liere
Subject: Re: cp -p loses precision on the timestamp of the copy
Date: Sat, 2 Feb 2008 06:47:56 -0800
User-agent: Mutt/1.5.4i

> It would be interesting to know the strace output to see what system
> calls were called and the values sent to them.
>
>   strace -e trace=file cp -p jnk jnkcopy
>
> On my system I see something similar to this:
>
>   utimes("/proc/self/fd/5", {1201838103, 1924}) = 0
>
> It would also be interesting to know the type of filesystem.  One way
> to see this is by looking with the -T option to df which will indicate
> the type of the filesystem.
>
>   df -T .
>
> Was this self compiled or did it come as part of a software
> distribution?

Hi Bob,

Below is the information that you requested. I do realize that this version
of coreutils is not current (as has been pointed out by Eric Blake), so if this
is a known problem being addressed/already addressed, that is good enough
for me. I was thrown by it because I had written some code that "assumed"
that, regardless of what timestamp precision existed on a particular
computer, all of linux would be consistent and either use the extended
precision or not.

This came as part of the Red Hat Enterprise Linux 4 distribution. After
installing RHEL4, I have run their update code periodically -- which
pulls new rpms from the Red Hat website and installs them.

Thanks for looking into this and responding to my report.

Ray

Here is the information you requested:
# ll jnk*
-rw-------  1 root root 4 Jan 31 18:40 jnk
-rw-------  1 root root 4 Jan 31 18:40 jnkcopy
#
# strace -e trace=file cp -p jnk jnkcopy2
execve("/bin/cp", ["cp", "-p", "jnk", "jnkcopy2"], [/* 55 vars */]) = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/libacl.so.1", O_RDONLY)      = 3
open("/lib/libselinux.so.1", O_RDONLY)  = 3
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
open("/lib/libattr.so.1", O_RDONLY)     = 3
access("/etc/selinux/", F_OK)           = 0
open("/etc/selinux/config", O_RDONLY)   = 3
open("/proc/mounts", O_RDONLY)          = 3
open("/proc/filesystems", O_RDONLY)     = 3
open("/proc/self/attr/current", O_RDONLY) = 4
lstat64("jnkcopy2", 0xbfebaf30)         = -1 ENOENT (No such file or directory)
stat64("jnk", {st_mode=S_IFREG|0600, st_size=4, ...}) = 0
open("jnk", O_RDONLY|O_LARGEFILE)       = 3
open("jnkcopy2", O_WRONLY|O_CREAT|O_LARGEFILE, 0100600) = 4
utimes("jnkcopy2", {1201833653, 245502}) = 0
chown32("jnkcopy2", 0, 0)               = 0
getxattr("jnk", "system.posix_acl_access", 0xbfeba8b0, 132) = -1 EOPNOTSUPP 
(Operation not supported)
setxattr("jnkcopy2", "system.posix_acl_access", 
"\x02\x00\x00\x00\x01\x00\x06\x00\xff\xff\xff\xff\x04\x00\x00\x00\xff\xff\xff\xff
 \x00\x00\x00\xff\xff\xff\xff", 28, 0) = -1 EOPNOTSUPP (Operation not supported)
chmod("jnkcopy2", 0100600)              = 0
Process 2819 detached
#
# df -T
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
              ext3   266963736  40328232 213074468  16% /
/dev/hda1     ext3      101086      9164     86703  10% /boot
none         tmpfs      257628         0    257628   0% /dev/shm
#
# uname -a
Linux localhost.localdomain 2.6.9-5.EL #1 Wed Jan 5 19:22:18 EST 2005 i686 i686 
i386 GNU/Linux
#
# 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
-rw-------  1 root root 4 2008-01-31 18:40:27.879358000 -0800 jnkcopy2
#

- - - end - - -




reply via email to

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