From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24714: delete-directory race condition Date: Mon, 17 Oct 2016 19:11:05 +0300 Message-ID: <83wph7x8fa.fsf@gnu.org> References: <83d1izzedl.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1476720887 32466 195.159.176.226 (17 Oct 2016 16:14:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2016 16:14:47 +0000 (UTC) Cc: 24714@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 17 18:14:39 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwAYF-0004Mp-4B for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Oct 2016 18:14:11 +0200 Original-Received: from localhost ([::1]:34306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwAYH-0006eI-9c for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Oct 2016 12:14:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwAWE-00059v-1h for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 12:12:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwAWA-0003Vj-Rz for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 12:12:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59001) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bwAWA-0003VT-Oe for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 12:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bwAWA-00075P-ID for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 12:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Oct 2016 16:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24714 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24714-submit@debbugs.gnu.org id=B24714.147672068127190 (code B ref 24714); Mon, 17 Oct 2016 16:12:02 +0000 Original-Received: (at 24714) by debbugs.gnu.org; 17 Oct 2016 16:11:21 +0000 Original-Received: from localhost ([127.0.0.1]:36958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwAVV-00074U-Cm for submit@debbugs.gnu.org; Mon, 17 Oct 2016 12:11:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34471) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwAVT-00074I-Ij for 24714@debbugs.gnu.org; Mon, 17 Oct 2016 12:11:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwAVL-0003FK-3W for 24714@debbugs.gnu.org; Mon, 17 Oct 2016 12:11:14 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46159) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwAVL-0003FF-0w for 24714@debbugs.gnu.org; Mon, 17 Oct 2016 12:11:11 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1661 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bwAVK-0005KK-4T; Mon, 17 Oct 2016 12:11:10 -0400 In-reply-to: (message from Glenn Morris on Mon, 17 Oct 2016 11:52:31 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124592 Archived-At: > From: Glenn Morris > Cc: 24714@debbugs.gnu.org > Date: Mon, 17 Oct 2016 11:52:31 -0400 > > Eli Zaretskii wrote: > > >> will fail with "No such file or directory" if a file in /tmp/foo > >> happen to be deleted by some other process in between the time that > >> delete-directory calls directory-files and the time it calls delete-file. > > > > IMO, delete-directory should simply catch ENOENT errors and ignore > > them when it deletes files and subdirectories under the "recursive" > > option. > > I don't think that's enough, since a file could equally well be > _created_ by some other process after delete-directory calls directory-files. It will solve your use case, with files under /tmp, won't it? A partial solution is better than no solution at all, IMO. > Frankly I don't see how Emacs's delete-directory can work reliably as > currently implemented. Patches to reimplement it are also welcome.