all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel@gnu.org
Subject: Re: Locking files for CLASH_DETECTION now supported on MS-Windows
Date: Mon, 25 Feb 2013 20:41:17 +0200	[thread overview]
Message-ID: <83txp0i6cy.fsf@gnu.org> (raw)
In-Reply-To: <512BA7F6.4010304@cs.ucla.edu>

> Date: Mon, 25 Feb 2013 10:05:42 -0800
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: emacs-devel@gnu.org
> 
> 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	other threads:[~2013-02-25 18:41 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 17:43 Locking files for CLASH_DETECTION now supported on MS-Windows Eli Zaretskii
2013-02-25 18:05 ` Paul Eggert
2013-02-25 18:41   ` Eli Zaretskii [this message]
2013-02-25 18:56     ` Paul Eggert
2013-02-26  2:03       ` Paul Eggert
2013-02-26  2:43         ` Daniel Colascione
2013-02-26  3:23           ` Paul Eggert
2013-02-26  4:02         ` Eli Zaretskii
2013-02-26  4:28           ` Daniel Colascione
2013-02-26 17:45             ` Eli Zaretskii
2013-02-26  6:05           ` Paul Eggert
2013-02-26 18:41             ` Eli Zaretskii
2013-02-26 18:51               ` Eli Zaretskii
2013-02-26  4:00       ` Eli Zaretskii
2013-02-26  5:46         ` Paul Eggert
2013-02-26 18:02           ` Eli Zaretskii
2013-02-26 18:17       ` Eli Zaretskii
2013-02-26 22:34         ` Paul Eggert
2013-02-27  4:01           ` Eli Zaretskii
2013-02-27  7:45             ` Paul Eggert
2013-02-27 19:02               ` Eli Zaretskii
2013-02-27 19:01           ` Eli Zaretskii
2013-02-25 19:39     ` Glenn Morris
2013-02-25 19:43       ` Eli Zaretskii
2013-02-25 20:35   ` Stefan Monnier
2013-02-25 22:49     ` Paul Eggert
2013-02-26  3:49       ` Eli Zaretskii
2013-02-26 12:56       ` Richard Stallman
2013-02-26  3:40     ` 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=83txp0i6cy.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@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.