all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: 9000@debbugs.gnu.org
Subject: bug#9000: patch for higher-resolution time stamps
Date: Mon, 04 Jul 2011 23:40:43 -0700	[thread overview]
Message-ID: <4E12B1EB.9060406@cs.ucla.edu> (raw)

Currently, Emacs supports time stamps to at most microsecond
resolution, and often to only 1-second resolution, even though most
modern systems have nanosecond-resolution time stamps for clock and
file time stamps.  This leads to some problems, for example:

 * "C-u M-x copy-file RET A RET B" discards the fractional part of A's
   time stamp when copying A to B (except for Windows, which I've been
   told uses special code to preserve the time stamp correctly).

 * The file-attributes function truncates file time stamps to
   one-second resolution, making it impossible for a dired written in
   Emacs to emulate the behavior of "ls --full-time".

 * (format-time-string "%s.%N") is supposed to output
   nanosecond-resolution time stamps, but on the Emacs trunk it always
   outputs a multiple of one microsecond, even when the system clock
   supports nanosecond resolution.

 * If some other process modifies a file during the same second that
   Emacs gets the file's time stamp, Emacs won't notice the conflict,
   as the visited-file-modtime function supports only 1-second
   resolution.  If Emacs used nanosecond-resolution time stamps, this
   race condition would be much less likely.

None of these problems are fatal, but they are annoyances that could
lead to real problems (e.g., when working with "make", which uses
high-resolution file time stamps).

I've proposed a patch for this:

http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00015.html
http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00016.html
http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00017.html
http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00018.html
http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00019.html
http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00020.html
http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00021.html

Stefan asked me in
<http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00069.html>
to make the patch more upward-compatible, by appending a new
picosecond count to the end of the time stamp list, rather than
changing the microsecond to a nanosecond count (which would likely
break more code).  I'll do that soon, but thought I'd first file a bug
report to make this whole issue easier to track.

In part I am also following up to Stefan's suggestion
<http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00217.html>
to have a bug report for this issue.





             reply	other threads:[~2011-07-05  6:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05  6:40 Paul Eggert [this message]
2011-07-05  6:57 ` bug#9000: More-compatible proposal, using (HIGH LOW USEC PSEC) time stamps Paul Eggert
2011-07-06 17:00   ` bug#9000: Update time patch for Frandom, pthread_sigmask, etc Paul Eggert
2012-05-04 20:52 ` bug#9000: 2012-05-04 version of patch Paul Eggert
2012-05-27  3:08   ` Paul Eggert
2012-06-22 21:21 ` bug#9000: patch for higher-resolution time stamps Paul Eggert
2012-06-23  8:39   ` Eli Zaretskii
2012-06-23 10:48     ` Eli Zaretskii
2012-06-23 17:57       ` Paul Eggert
2012-06-23 19:09         ` Eli Zaretskii
2012-06-23 19:42           ` Eli Zaretskii
2012-06-23 22:45             ` Paul Eggert
2012-06-24  2:57               ` Eli Zaretskii
2012-06-24  4:31                 ` Paul Eggert
2012-06-24 19:26                   ` Eli Zaretskii
2012-06-23 18:55       ` Paul Eggert
2012-06-23 19:08         ` Eli Zaretskii
2012-06-23 22:34           ` Paul Eggert
2012-06-24 17:23             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E12B1EB.9060406@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=9000@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.