help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: file changed on disk


From: Geert Fannes
Subject: RE: file changed on disk
Date: Mon, 7 Feb 2005 17:25:37 +0100

I just found a solution for my first question:
 ** Can I disable this timestamp checking behaviour of emacs?

By replacing in emacs-21.3/src/fileio.c

 if (st.st_mtime == b->modtime
      /* If both are positive, accept them if they are off by one second.  */
      || (st.st_mtime > 0 && b->modtime > 0
          && (st.st_mtime == b->modtime + 1
              || st.st_mtime == b->modtime - 1)))

to

  if (st.st_mtime == b->modtime
      /* If both are positive, accept them if they are off by one second.  */
      || (st.st_mtime > 0 && b->modtime > 0))
//          && (st.st_mtime == b->modtime + 1
//              || st.st_mtime == b->modtime - 1)))

the timecheck is effectively removed.

First, I tried to replace it with something like

  if (st.st_mtime == b->modtime
      /* If both are positive, accept them if they are off by one second.  */
      || (st.st_mtime > 0 && b->modtime > 0))
          && (st.st_mtime - b->modtime <= 5)
              && (b->modtime - st.st_mtime <= 5)))

which would allow any modification date that is off by a maximum of 5 seconds from the initial date, but that did not work. Does anyone know why this does not work? Does anyone know what happens if you substract two timestamps (I found somewhere that stat.st_mtime contains two members, one for the seconds and stuff and one for the nanosecond. Maybe my substraction procedure from above only allows timestamps that are off by 5 nanoseconds...)

I found something else that is strange: the original version of emacs on my Slackware box is 21.3.2. To get access to the source code, I downloaded the latest version from the emacs site. To my surprise,t his was version 21.3.1. Next to this, I had to close my shell and start a new one before the newly installed emacs version would run, Linux kept on starting 21.3.2 for some reason I am not aware off.

Greetings,
Geert.


reply via email to

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