From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.bugs Subject: Re: backup-buffer-copy loops if old backup can't be deleted Date: Thu, 23 Aug 2007 16:59:49 -0400 Message-ID: References: <46CAD810.3050904@gmx.net> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1187902920 5396 80.91.229.12 (23 Aug 2007 21:02:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 23 Aug 2007 21:02:00 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: Martin von Gagern , bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 23 23:01:57 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IOJoT-0005fH-3n for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Aug 2007 23:01:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IOJoS-0002aH-Gg for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Aug 2007 17:01:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IOJmS-0001Nu-HJ for bug-gnu-emacs@gnu.org; Thu, 23 Aug 2007 16:59:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IOJmR-0001NG-0h for bug-gnu-emacs@gnu.org; Thu, 23 Aug 2007 16:59:52 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IOJmQ-0001N7-RB for bug-gnu-emacs@gnu.org; Thu, 23 Aug 2007 16:59:50 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IOJmQ-000726-Gp for bug-gnu-emacs@gnu.org; Thu, 23 Aug 2007 16:59:50 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1IOJmP-0003vq-UE; Thu, 23 Aug 2007 16:59:49 -0400 In-reply-to: <46CAD810.3050904@gmx.net> (message from Martin von Gagern on Tue, 21 Aug 2007 14:18:24 +0200) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16429 Archived-At: - (condition-case nil - (delete-file to-name) - (file-error nil)) + (and (file-exists-p to-name) + (delete-file to-name)) I think that fix is actually correct. It is copy-file that detects the race condition. As long as copy-file is inside a loop, creation of the file by another process will be dealt with. So this change should be installed. I think there is no need to explicitly check whether the directory is writable. What would be the purpose of that?