From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Locking files for CLASH_DETECTION now supported on MS-Windows Date: Mon, 25 Feb 2013 20:41:17 +0200 Message-ID: <83txp0i6cy.fsf@gnu.org> References: <83wqtwi90o.fsf@gnu.org> <512BA7F6.4010304@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1361817699 28351 80.91.229.3 (25 Feb 2013 18:41:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Feb 2013 18:41:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 25 19:42:02 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UA2zt-0008J4-0E for ged-emacs-devel@m.gmane.org; Mon, 25 Feb 2013 19:41:57 +0100 Original-Received: from localhost ([::1]:51548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA2zY-0006rs-BS for ged-emacs-devel@m.gmane.org; Mon, 25 Feb 2013 13:41:36 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA2zT-0006pQ-J1 for emacs-devel@gnu.org; Mon, 25 Feb 2013 13:41:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UA2zP-0006KS-5l for emacs-devel@gnu.org; Mon, 25 Feb 2013 13:41:31 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:33825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA2zO-0006K6-TV for emacs-devel@gnu.org; Mon, 25 Feb 2013 13:41:27 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MIS00D00H8UAA00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Mon, 25 Feb 2013 20:41:24 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MIS00CF3H90ZA60@a-mtaout20.012.net.il>; Mon, 25 Feb 2013 20:41:24 +0200 (IST) In-reply-to: <512BA7F6.4010304@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157333 Archived-At: > Date: Mon, 25 Feb 2013 10:05:42 -0800 > From: Paul Eggert > 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.