From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: owner@emacsbugs.donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#3911: marked as done (get-free-disk-space race condition on default-directory test) Date: Fri, 02 Oct 2009 00:35:05 +0000 Message-ID: References: <87bpkq7icu.fsf@blah.blah> <87tz13jb3p.fsf@blah.blah> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1254443705-30294-0" X-Trace: ger.gmane.org 1254444451 7605 80.91.229.12 (2 Oct 2009 00:47:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Oct 2009 00:47:31 +0000 (UTC) To: Kevin Ryde Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 02 02:47:24 2009 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 1MtWIs-00059p-FT for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Oct 2009 02:47:22 +0200 Original-Received: from localhost ([127.0.0.1]:46005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtWIr-0005IE-UF for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Oct 2009 20:47:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtWIl-0005EF-Np for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 20:47:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtWIh-00056j-Rh for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 20:47:15 -0400 Original-Received: from [199.232.76.173] (port=52114 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtWIh-00056R-F9 for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 20:47:11 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:38666) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MtWIg-0004FU-Pt for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 20:47:11 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n920l7vV032196; Thu, 1 Oct 2009 17:47:08 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n920Z5Vk030368; Thu, 1 Oct 2009 17:35:05 -0700 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: closed 3911 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:31627 Archived-At: This is a multi-part message in MIME format... ------------=_1254443705-30294-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Fri, 02 Oct 2009 10:24:49 +1000 with message-id <87bpkq7icu.fsf@blah.blah> and subject line Re: bug#3911: get-free-disk-space when default-directory d= oesn't exist has caused the Emacs bug report #3911, regarding get-free-disk-space race condition on default-directory test to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com immediately.) --=20 3911: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D3911 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems ------------=_1254443705-30294-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 23 Jul 2009 22:21:30 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.5 required=4.0 tests=AWL,FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6NMLOj5007682 for ; Thu, 23 Jul 2009 15:21:25 -0700 Received: from mx10.gnu.org ([199.232.76.166]:52480) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MU6fD-0006qE-BM for emacs-pretest-bug@gnu.org; Thu, 23 Jul 2009 18:21:23 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MU6f9-00061L-77 for emacs-pretest-bug@gnu.org; Thu, 23 Jul 2009 18:21:21 -0400 Received: from mailout1-1.pacific.net.au ([61.8.2.208]:43106 helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MU6f8-00060X-BN for emacs-pretest-bug@gnu.org; Thu, 23 Jul 2009 18:21:19 -0400 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id 2BE124FD5DA for ; Fri, 24 Jul 2009 08:21:10 +1000 (EST) Received: from blah.blah (ppp280A.dyn.pacific.net.au [61.8.40.10]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 6A7CB27428 for ; Fri, 24 Jul 2009 08:21:03 +1000 (EST) Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1MU6do-0002Ax-0S for emacs-pretest-bug@gnu.org; Fri, 24 Jul 2009 08:19:56 +1000 From: Kevin Ryde To: emacs-pretest-bug@gnu.org Subject: 23.1.50; get-free-disk-space relative to non-existent default-directory Date: Fri, 24 Jul 2009 08:19:54 +1000 Message-ID: <87tz13jb3p.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) --=-=-= On a non-existent directory get-free-disk-space returns nil, eg. (get-free-disk-space "/no/such/dir") => nil But if it's done by a relative path from a default-directory which doesn't exist, then the answer is the space in your home directory (let ((default-directory "/no/such/dir")) (get-free-disk-space ".")) => 3705637 I hoped the two answers would be the same. This is with the "df"-running code in get-free-disk-space, ie. no `file-system-info' function. Perhaps absolutize per below with an inserted setq, the diff being just re-indent. (I still think the use of the home dir there is either complicated and unnecessary, or complicated and necessary everywhere. Or maybe better call-process could not attempt a chdir at all if a caller doesn't care about the current directory. But leaving that unchanged as yet.) 2009-07-24 Kevin Ryde * files.el (get-free-disk-space): Absolutize the dir before changing default-directory, so as not to answer about a different directory. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=files.el.disk-space-absolutize.diff *** files.el 24 Jul 2009 07:35:37 +1000 1.1063 --- files.el 24 Jul 2009 08:07:01 +1000 *************** *** 5394,5410 **** (save-match-data (with-temp-buffer (when (and directory-free-space-program ! (let ((default-directory ! (if (and (not (file-remote-p default-directory)) ! (file-directory-p default-directory) ! (file-readable-p default-directory)) ! default-directory ! (expand-file-name "~/")))) ! (eq (call-process directory-free-space-program ! nil t nil ! directory-free-space-args ! dir) ! 0))) ;; Usual format is a header line followed by a line of ;; numbers. (goto-char (point-min)) --- 5394,5413 ---- (save-match-data (with-temp-buffer (when (and directory-free-space-program ! (progn ! ;; absolutize before changing default-directory ! (setq dir (expand-file-name dir)) ! (let ((default-directory ! (if (and (not (file-remote-p default-directory)) ! (file-directory-p default-directory) ! (file-readable-p default-directory)) ! default-directory ! (expand-file-name "~/")))) ! (eq (call-process directory-free-space-program ! nil t nil ! directory-free-space-args ! dir) ! 0)))) ;; Usual format is a header line followed by a line of ;; numbers. (goto-char (point-min)) --=-=-= In GNU Emacs 23.1.50.4 (i586-pc-linux-gnu, GTK+ Version 2.16.4) of 2009-07-24 on blah.blah configured using `configure 'CFLAGS=-O -g' '--prefix=/down/emacs/b/inst' '--with-x-toolkit=gtk'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_AU value of $XMODIFIERS: nil locale-coding-system: iso-latin-1-unix default-enable-multibyte-characters: t --=-=-=-- ------------=_1254443705-30294-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 3911-done) by emacsbugs.donarmstrong.com; 2 Oct 2009 00:26:13 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.4 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mailout2.pacific.net.au (mailout2-4.pacific.net.au [61.8.2.227]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n920QBRs029506 for <3911-done@emacsbugs.donarmstrong.com>; Thu, 1 Oct 2009 17:26:13 -0700 Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id 8CE8619346A for <3911-done@emacsbugs.donarmstrong.com>; Fri, 2 Oct 2009 10:26:10 +1000 (EST) Received: from blah.blah (ppp24D8.dyn.pacific.net.au [61.8.36.216]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id EEDC18C2C for <3911-done@emacsbugs.donarmstrong.com>; Fri, 2 Oct 2009 10:26:04 +1000 (EST) Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1MtVx3-0006td-Tw for 3911-done@emacsbugs.donarmstrong.com; Fri, 02 Oct 2009 10:24:49 +1000 From: Kevin Ryde To: 3911-done@emacsbugs.donarmstrong.com Subject: Re: bug#3911: get-free-disk-space when default-directory doesn't exist References: <871vnclhoz.fsf@cyd.mit.edu> <87bpme9dhv.fsf@blah.blah> <87my5yexy4.fsf@stupidchicken.com> <87r5v7xxz5.fsf@blah.blah> <877hwsbwta.fsf@blah.blah> <87fxbbo14y.fsf@blah.blah> <87prab5tta.fsf@blah.blah> <878wgrbnsw.fsf@blah.blah> Date: Fri, 02 Oct 2009 10:24:49 +1000 In-Reply-To: <878wgrbnsw.fsf@blah.blah> (Kevin Ryde's message of "Mon, 07 Sep 2009 10:28:47 +1000") Message-ID: <87bpkq7icu.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Installed by Stefan. ------------=_1254443705-30294-0--