bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] cp --update --preserve


From: Paolo Montrasio
Subject: Re: [PATCH] cp --update --preserve
Date: Wed, 21 Jan 2004 11:46:41 +0100

On Fri, 16 Jan 2004 09:13:01 +0100, Jim Meyering wrote:
> I realized that, contrary to our patches, these proposed changes should
> be independent of `preserve_timestamps'.

Jim,

you're right. However there is more to this problem than that because we have 
to deal with two different causes of failure.

Failure 1)
When a new file is created the nanosecond component of the timestamp cannot be 
set by cp. This is a quote from cp's code:

>       if (x->preserve_timestamps)
>         {
>           struct utimbuf utb;
>       
>           /* There's currently no interface to set file timestamps with
>              better than 1-second resolution, so discard any fractional
>              part of the source timestamp.  */
>       
>           utb.actime = src_sb.st_atime;
>           utb.modtime = src_sb.st_mtime;
>       
>           if (utime (dst_path, &utb))

This means that if we try to do it with --preserve we get a timestamp that is 
older than the one of the source file.

Failure 2)
The filesystem might not have a nanosecond time resolution, so we have to 
properly identify the supported resolution and the round off method (down or 
up?)

As there are two different failures there should be two different solutions. 
For the first one, not checking the


--
Play Go! http://www.figg.org





reply via email to

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