From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: backup method Date: Thu, 27 Jan 2005 17:18:57 -0500 Message-ID: References: <20050127000210.GA6167@boetes.org> <200501270045.j0R0jIq06197@raven.dms.auburn.edu> <20050127015432.GB6167@boetes.org> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1106864916 31052 80.91.229.6 (27 Jan 2005 22:28:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 27 Jan 2005 22:28:36 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 27 23:28:06 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CuI7R-0007IH-00 for ; Thu, 27 Jan 2005 23:28:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CuIJp-0006Cg-67 for ged-emacs-devel@m.gmane.org; Thu, 27 Jan 2005 17:40:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CuIGL-0004L1-1N for emacs-devel@gnu.org; Thu, 27 Jan 2005 17:37:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CuIGF-0004II-0t for emacs-devel@gnu.org; Thu, 27 Jan 2005 17:37:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CuIGE-0004FR-QY for emacs-devel@gnu.org; Thu, 27 Jan 2005 17:37:10 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CuI0i-0005hb-3j for emacs-devel@gnu.org; Thu, 27 Jan 2005 17:21:08 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1CuHyb-0006AB-00; Thu, 27 Jan 2005 17:18:57 -0500 Original-To: Han Boetes In-reply-to: <20050127015432.GB6167@boetes.org> (message from Han Boetes on Thu, 27 Jan 2005 02:54:10 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:32597 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32597 The default backup method is mv and then create a new file. That's nice if you really want to keep the timestamp intact. But if you use emacs with crontab -e you remove the tmpfile and since the filedescriptor is still open your update to your cron is lost -- without warning. It was pretty hard to discover why this happened. So I would like to suggest to make backup by copying the default. I won't change it in general, but we could probably arrange to use backup by copying for *this specific case*. Can you give a precise recipe for distinguishing this case--a regexp for these file names, perhaps? If the file is open ie another program has fopen'ed the file then you have an exceptional case. lsof and fstat ( for BSD ) can detect open file descriptors. I suppose emacs can do the same. It is not the case in general that the existence of other descriptors means it is better to backup by copying. That's what you want in this particular case, for crontab files. However, in other cases where another program is reading the old version, it should be able to continue reading the old version, and editing the file should not interfere with it.