emacs-devel
[Top][All Lists]
Advanced

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

Re: Locking files for CLASH_DETECTION now supported on MS-Windows


From: Eli Zaretskii
Subject: Re: Locking files for CLASH_DETECTION now supported on MS-Windows
Date: Mon, 25 Feb 2013 20:41:17 +0200

> Date: Mon, 25 Feb 2013 10:05:42 -0800
> From: Paul Eggert <address@hidden>
> CC: address@hidden
> 
> On 02/25/13 09:43, Eli Zaretskii wrote:
> > Trunk revision 111877 implements file locking and clash detection for
> > MS-Windows (see the node "Interlocking" in the Emacs manual for the
> > details),
> 
> The MS-Windows code uses regular files while the GNUish code
> uses symbolic links.  Suppose one instance of Emacs is running
> on a GNUish host while the other one is running on MS-Windows,
> and they are both accessing the same file via NFS.  Won't
> that cause problems?

If MS-Windows creates the lock file first, then the Posix host will
see that it's a regular file and skip it.  If a Posix host creates the
lock file first, things depend on how symlinks are supported via NFS
to Windows.  For example, if Emacs on Windows will see a symlink as an
empty file, then it will skip it.

If someone tries this with NFS and reports results, we will see if
some additional code is needed to avoid problems in this scenario.

> Also, suppose an MS-Windows Emacs uses .#FOO as a lock file while
> a non-Emacs program uses .#FOO as a regular file for something else.
> Won't there be problems of a different sort?

The test in IS_LOCK_FILE might detect that it cannot be a lock file.
If that fails, then Emacs at worst might display a prompt for stealing
the lock with some weirdo user and host name, and at best it will
silently fail to lock the file.  At least this is my reading of
filelock.c and of its callers.

Anyway, file names that start with a period are pretty unusual on
Windows, and a with period followed by a hash sign are extremely rare
outside of the Emacs world.  E.g., I have 73 such files on my disk,
all of them from Emacs sessions.



reply via email to

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