help-make
[Top][All Lists]
Advanced

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

Re: GMAKE and timestamps


From: Paul D. Smith
Subject: Re: GMAKE and timestamps
Date: Wed, 25 Apr 2001 09:37:58 -0400

%% "Bhatt, Milan C" <address@hidden> writes:

  bmc> I have a simple question.  What level of granularity does GMAKE
  bmc> observe within a file's timestamp to determine if a target is out
  bmc> of date?

This depends on your operating system.

GNU make will use whatever granularity is supported by the filesystem
the files are stored on.

  bmc> That is does GMAKE determine the older file by looking at the
  bmc> minutes field, seconds field, or milliseconds field of the
  bmc> timestamp?

Most operating systems/filesystems support only the stat() system call
for retrieving information about the modification time of a file.  That
system call returns file modification timestamps with a granularity of
one second.

On those systems (newer Solaris, HP-UX, Linux, etc. boxes, for example)
which support a nanosecond timestamp, GNU make will also support that.
Note that even though the OS interface supports nanoseconds not all
systems are capable of actually using the entire nanosecond value.

Also note that not all UNIX tools can support this, which means that
sometimes you cannot use them (for example, using "cp -p xxx yyy" will
not preserve the nanosecond part of the timestamp on the file "yyy"; you
have similar problems with "touch").

Also note that even on those OS's where the normal timestamps are in
nanoseconds, archive timestamps (which are stored in the archive file
libxxx.a, not the filesystem) are always on a granularity of one second,
because that's they format of a .a file.

Finally, note that on some seriously pathetic filesystems, such as FAT
and FAT32, the granularity is even worse: about _3_ seconds.  Not sure
about NTFS.  Although the OS returns values that purport to be
seconds-based, testing has shown that they are not accurate to more than
3 seconds.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "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]