unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* file changed on disk
@ 2005-02-07 14:10 Geert Fannes
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Fannes @ 2005-02-07 14:10 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 1511 bytes --]

Hello,
I'm using emacs on a remote cifs-mounted filesystem (cifs is the next-generation samba filesystem client to mount windows-shares (my company chose for a Dell PowerVault 745N to store all our internal information)). All goes well until after some time emacs starts complaining that the file changed on disk, I guess meaning that the original file has a modified time stamp since emacs opened it.

I found out that the timestamps on the cifs-mounted filesystem contain extra information after the second by using a command like:

$ls --full-time -cifs-file.txt
$-rw-r--r--  1 gef users 0 2005-02-07 14:46:10.041579900 +0100 cifs-file.txt

while this is not the case for a local file (ReiserFS):

$ls --full-time local-file.txt
$-rw-r--r--  1 gef users 0 2005-02-07 14:48:11.000000000 +0100 local-file.txt

I somehow have the feeling that this could be causing the problem, for instance because emacs internally stores the initial file timestamp without taking care of the extra numbers, rendering into a different timestamp than the one with the extra numbers.

With this in mind, I have a few questions:

 ** Can I disable this timestamp checking behaviour of emacs?
 ** Any idea if these extra numbers are causing the problem?
 ** Any idea how I can solve this problem (I also mailed to Steve French, the cifs developer, for help)

Greetings,
Geert Fannes.

PS: I'm using Slackware 10.0 in combination with the 2.6.11-rc2 kernel and emacs 21.3.2 (the one the Slackware installs)

[-- Attachment #1.2: Type: text/html, Size: 1990 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: file changed on disk
@ 2005-02-07 16:25 Geert Fannes
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Fannes @ 2005-02-07 16:25 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 1905 bytes --]

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.

[-- Attachment #1.2: Type: text/html, Size: 3036 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-07 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-07 14:10 file changed on disk Geert Fannes
  -- strict thread matches above, loose matches on Subject: below --
2005-02-07 16:25 Geert Fannes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).