help-make
[Top][All Lists]
Advanced

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

Re: On NFS, cp -a copies non-integer timestamp as integer timestamp?


From: Paul Smith
Subject: Re: On NFS, cp -a copies non-integer timestamp as integer timestamp?
Date: Tue, 15 May 2007 00:05:37 -0400

On Tue, 2007-05-15 at 02:50 +0000, David Wuertele wrote:
> What I found was that the dependency (file being copied by cp -a) had
> a non-integral mtime, but the target always had an integer mtime:

> Can anyone explain why cp -a might copy the fractional portion of the mtime
> *sometimes* but not others?

Your attempt to reproduce the behavior is invalidated by the fact that
you didn't duplicate the real conditions: in your test you copied one
file to another in the same directory.  In the real environment you
copied one file to a completely different filesystem, and not only that
but it was a different TYPE of filesystem (local, presumably ext3 or ufs
or something, vs. NFS).

Timestamps are stored on the filesystem and so the maximum resolution
for the timestamp is dictated by (among other things) the filesystem
type.  In this case, apparently your implementation of NFS does not have
support for sub-second timestamps, or else cp is behaving differently if
it detects that the remote filesystem is NFS.


You can look up the .LOW_RESOLUTION_TIMESTAMP pseudo target in the GNU
make manual for one way to manage this situation.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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