From unknown Sat Jun 21 12:35:34 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2631: get-free-disk-space when default-directory doesn't exist Reply-To: Kevin Ryde , 2631@debbugs.gnu.org Resent-From: Kevin Ryde Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 10 Mar 2009 22:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 2631 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123672388628795 (code B ref -1); Tue, 10 Mar 2009 22:30:03 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 10 Mar 2009 22:24:46 +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=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2AMOfL0028789 for ; Tue, 10 Mar 2009 15:24:43 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LhANN-0007jw-Lp for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 18:24:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LhANN-0007j3-0I for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 18:24:41 -0400 Received: from [199.232.76.173] (port=53023 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhANM-0007is-OR for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 18:24:40 -0400 Received: from mailout2-2.pacific.net.au ([61.8.2.225]:37345 helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LhANL-0005Kb-Rb for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 18:24:40 -0400 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout2.pacific.net.au (Postfix) with ESMTP id 020581B3FB0 for ; Wed, 11 Mar 2009 09:24:30 +1100 (EST) Received: from blah.blah (ppp26D7.dyn.pacific.net.au [61.8.38.215]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 0D4C027431 for ; Wed, 11 Mar 2009 09:24:28 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1LhAMn-0005hd-Kd for bug-gnu-emacs@gnu.org; Wed, 11 Mar 2009 09:24:05 +1100 From: Kevin Ryde To: bug-gnu-emacs@gnu.org Date: Wed, 11 Mar 2009 09:24:04 +1100 Message-ID: <87wsaxhv97.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (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) --=-=-= Evaluating (with-temp-buffer (setq default-directory "/no/such/dir") (get-free-disk-space "/tmp")) gets an error (file-error "Setting current directory" "no such file or directory" "/no/such/dir") where I hoped it wouldn't care about default-directory, only the given directory argument. Perhaps a let-bind per below. In GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11) of 2008-11-10 on raven, modified by Debian configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs22:/etc/emacs:/usr/local/share/emacs/22.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/22.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/22.2/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' 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 locale-coding-system: iso-8859-1 default-enable-multibyte-characters: t --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=files.el.free-space.diff *** files.el 11 Mar 2009 08:46:04 +1100 1.1038 --- files.el 11 Mar 2009 09:14:14 +1100 *************** *** 5336,5345 **** (save-match-data (with-temp-buffer (when (and directory-free-space-program ! (eq 0 (call-process directory-free-space-program ! nil t nil ! directory-free-space-args ! dir))) ;; Usual format is a header line followed by a line of ;; numbers. (goto-char (point-min)) --- 5336,5346 ---- (save-match-data (with-temp-buffer (when (and directory-free-space-program ! (let ((default-directory "/")) ! (eq 0 (call-process directory-free-space-program ! nil t nil ! directory-free-space-args ! dir)))) ;; Usual format is a header line followed by a line of ;; numbers. (goto-char (point-min)) --=-=-=-- From unknown Sat Jun 21 12:35:34 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2631: get-free-disk-space when default-directory doesn't exist Reply-To: Stefan Monnier , 2631@debbugs.gnu.org Resent-From: Stefan Monnier Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 11 Mar 2009 02:15:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 2631 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123673743222757 (code B ref -1); Wed, 11 Mar 2009 02:15:03 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 11 Mar 2009 02:10:32 +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=-0.5 required=4.0 tests=HAS_BUG_NUMBER,XIRONPORT autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2B2ATsm022751 for ; Tue, 10 Mar 2009 19:10:30 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LhDtt-0002k0-Dp for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 22:10:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LhDts-0002ja-Pv for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 22:10:29 -0400 Received: from [199.232.76.173] (port=34719 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhDts-0002jX-MO for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 22:10:28 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:13561) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LhDts-0008LP-Ee for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 22:10:28 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhIFAAq7tklFxL+1/2dsb2JhbACBTtBPhA0GhCU X-IronPort-AV: E=Sophos;i="4.38,338,1233550800"; d="scan'208";a="35015565" Received: from 69-196-191-181.dsl.teksavvy.com (HELO ceviche.home) ([69.196.191.181]) by ironport2-out.teksavvy.com with ESMTP; 10 Mar 2009 22:10:13 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 6EE35B4121; Tue, 10 Mar 2009 22:10:13 -0400 (EDT) From: Stefan Monnier To: Kevin Ryde Cc: 2631@debbugs.gnu.org, bug-gnu-emacs@gnu.org Message-ID: References: <87wsaxhv97.fsf@blah.blah> Date: Tue, 10 Mar 2009 22:10:13 -0400 In-Reply-To: <87wsaxhv97.fsf@blah.blah> (Kevin Ryde's message of "Wed, 11 Mar 2009 09:24:04 +1100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. > *** files.el 11 Mar 2009 08:46:04 +1100 1.1038 > --- files.el 11 Mar 2009 09:14:14 +1100 > *************** > *** 5336,5345 **** > (save-match-data > (with-temp-buffer > (when (and directory-free-space-program > ! (eq 0 (call-process directory-free-space-program > ! nil t nil > ! directory-free-space-args > ! dir))) > ;; Usual format is a header line followed by a line of > ;; numbers. > (goto-char (point-min)) > --- 5336,5346 ---- > (save-match-data > (with-temp-buffer > (when (and directory-free-space-program > ! (let ((default-directory "/")) > ! (eq 0 (call-process directory-free-space-program > ! nil t nil > ! directory-free-space-args > ! dir)))) > ;; Usual format is a header line followed by a line of > ;; numbers. > (goto-char (point-min)) That would probably work OK, but why not bind default-directory to dir? And even use process-file, while we're at it, so it has a chance to work on Tramp. Stefan From unknown Sat Jun 21 12:35:34 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2631: get-free-disk-space when default-directory doesn't exist Reply-To: Eli Zaretskii , 2631@debbugs.gnu.org Resent-From: Eli Zaretskii Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 11 Mar 2009 04:30:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 2631 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 2631-submit@emacsbugs.donarmstrong.com id=B2631.123674544223591 (code B ref 2631); Wed, 11 Mar 2009 04:30:05 +0000 Received: (at 2631) by emacsbugs.donarmstrong.com; 11 Mar 2009 04:24:02 +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=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mtaout6.012.net.il (mtaout6.012.net.il [84.95.2.16]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2B4Nw7v023584 for <2631@emacsbugs.donarmstrong.com>; Tue, 10 Mar 2009 21:23:59 -0700 Received: from conversion-daemon.i-mtaout6.012.net.il by i-mtaout6.012.net.il (HyperSendmail v2007.08) id <0KGB00C00QNZ9Y00@i-mtaout6.012.net.il> for 2631@emacsbugs.donarmstrong.com; Wed, 11 Mar 2009 06:24:35 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.127.228.91]) by i-mtaout6.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KGB00KT1QWZMOA0@i-mtaout6.012.net.il>; Wed, 11 Mar 2009 06:24:35 +0200 (IST) Date: Wed, 11 Mar 2009 06:23:49 +0200 From: Eli Zaretskii In-reply-to: X-012-Sender: halo1@inter.net.il To: Stefan Monnier , 2631@debbugs.gnu.org Cc: user42@zip.com.au Message-id: References: <87wsaxhv97.fsf@blah.blah> > From: Stefan Monnier > Date: Tue, 10 Mar 2009 22:10:13 -0400 > Cc: bug-gnu-emacs@gnu.org, 2631@emacsbugs.donarmstrong.com > > > *** files.el 11 Mar 2009 08:46:04 +1100 1.1038 > > --- files.el 11 Mar 2009 09:14:14 +1100 > > *************** > > *** 5336,5345 **** > > (save-match-data > > (with-temp-buffer > > (when (and directory-free-space-program > > ! (eq 0 (call-process directory-free-space-program > > ! nil t nil > > ! directory-free-space-args > > ! dir))) > > ;; Usual format is a header line followed by a line of > > ;; numbers. > > (goto-char (point-min)) > > --- 5336,5346 ---- > > (save-match-data > > (with-temp-buffer > > (when (and directory-free-space-program > > ! (let ((default-directory "/")) > > ! (eq 0 (call-process directory-free-space-program > > ! nil t nil > > ! directory-free-space-args > > ! dir)))) > > ;; Usual format is a header line followed by a line of > > ;; numbers. > > (goto-char (point-min)) > > That would probably work OK, but why not bind default-directory to dir? Yes, this is much better, since "/" is not guaranteed to work (accessibility and stuff). > And even use process-file, while we're at it, so it has a chance to work > on Tramp. Even better. From unknown Sat Jun 21 12:35:34 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2631: get-free-disk-space when default-directory doesn't exist Reply-To: Kevin Ryde , 2631@debbugs.gnu.org Resent-From: Kevin Ryde Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 11 Mar 2009 21:10:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 2631 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 2631-submit@emacsbugs.donarmstrong.com id=B2631.123680528317112 (code B ref 2631); Wed, 11 Mar 2009 21:10:05 +0000 Received: (at 2631) by emacsbugs.donarmstrong.com; 11 Mar 2009 21:01:23 +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=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mailout2.pacific.net.au (mailout2-2.pacific.net.au [61.8.2.225]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2BL1Fsn017106 for <2631@emacsbugs.donarmstrong.com>; Wed, 11 Mar 2009 14:01:16 -0700 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout2.pacific.net.au (Postfix) with ESMTP id 17F5E1B41B2; Thu, 12 Mar 2009 08:01:13 +1100 (EST) Received: from blah.blah (ppp2278.dyn.pacific.net.au [61.8.34.120]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 87ACC2740F; Thu, 12 Mar 2009 08:01:07 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1LhVX8-0000j7-IG; Thu, 12 Mar 2009 08:00:10 +1100 From: Kevin Ryde To: Stefan Monnier Cc: 2631@debbugs.gnu.org References: <87wsaxhv97.fsf@blah.blah> Date: Thu, 12 Mar 2009 08:00:10 +1100 Message-ID: <87ocw77p2d.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Stefan Monnier writes: > > why not bind default-directory to dir? I think that'd make it error out on a non-existant dir argument, where currently it returns nil (from the df parsing code, and it looks like from file-system-info in dosfns.c). There's a few other places binding to "/", like man.el and message.el, if it ought to be something else ... From unknown Sat Jun 21 12:35:34 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: owner@emacsbugs.donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: Kevin Ryde Subject: bug#2631 closed by Chong Yidong (Re: bug#2631: get-free-disk-space when default-directory doesn't exist) Message-ID: References: <87d4cjzf89.fsf@cyd.mit.edu> <87wsaxhv97.fsf@blah.blah> X-Emacs-PR-Message: they-closed 2631 X-Emacs-PR-Package: emacs Reply-To: 2631@debbugs.gnu.org Date: Sun, 15 Mar 2009 02:40:05 +0000 Content-Type: multipart/mixed; boundary="----------=_1237084805-9137-1" This is a multi-part message in MIME format... ------------=_1237084805-9137-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #2631: get-free-disk-space when default-directory doesn't exist It has been closed by Chong Yidong . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Chong Yidong by replying to this email. --=20 2631: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D2631 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1237084805-9137-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 2631-done) by emacsbugs.donarmstrong.com; 15 Mar 2009 02:32:59 +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=-3.0 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2F2Wuk0007749 for <2631-done@emacsbugs.donarmstrong.com>; Sat, 14 Mar 2009 19:32:57 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id AFB9657E211; Sat, 14 Mar 2009 22:34:14 -0400 (EDT) From: Chong Yidong To: Stefan Monnier Cc: Kevin Ryde , Eli Zaretskii , 2631-done@debbugs.gnu.org Subject: Re: bug#2631: get-free-disk-space when default-directory doesn't exist Date: Sat, 14 Mar 2009 22:34:14 -0400 Message-ID: <87d4cjzf89.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Stefan Monnier wrote: > That would probably work OK, but why not bind default-directory to > dir? And even use process-file, while we're at it, so it has a chance > to work on Tramp. I don't think there's any chance to make get-free-disk-space to work on remote files without major surgery (it currently returns nil immediately if the file is remote). I've checked in a modified version of Kevin's patch, which sets default-directory to "~/" rather than "/", but only if the existing default-directory is not usable. ------------=_1237084805-9137-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 10 Mar 2009 22:24:46 +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=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2AMOfL0028789 for ; Tue, 10 Mar 2009 15:24:43 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LhANN-0007jw-Lp for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 18:24:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LhANN-0007j3-0I for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 18:24:41 -0400 Received: from [199.232.76.173] (port=53023 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhANM-0007is-OR for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 18:24:40 -0400 Received: from mailout2-2.pacific.net.au ([61.8.2.225]:37345 helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LhANL-0005Kb-Rb for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 18:24:40 -0400 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout2.pacific.net.au (Postfix) with ESMTP id 020581B3FB0 for ; Wed, 11 Mar 2009 09:24:30 +1100 (EST) Received: from blah.blah (ppp26D7.dyn.pacific.net.au [61.8.38.215]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 0D4C027431 for ; Wed, 11 Mar 2009 09:24:28 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1LhAMn-0005hd-Kd for bug-gnu-emacs@gnu.org; Wed, 11 Mar 2009 09:24:05 +1100 From: Kevin Ryde To: bug-gnu-emacs@gnu.org Subject: get-free-disk-space when default-directory doesn't exist Date: Wed, 11 Mar 2009 09:24:04 +1100 Message-ID: <87wsaxhv97.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (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) --=-=-= Evaluating (with-temp-buffer (setq default-directory "/no/such/dir") (get-free-disk-space "/tmp")) gets an error (file-error "Setting current directory" "no such file or directory" "/no/such/dir") where I hoped it wouldn't care about default-directory, only the given directory argument. Perhaps a let-bind per below. In GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11) of 2008-11-10 on raven, modified by Debian configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs22:/etc/emacs:/usr/local/share/emacs/22.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/22.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/22.2/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' 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 locale-coding-system: iso-8859-1 default-enable-multibyte-characters: t --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=files.el.free-space.diff *** files.el 11 Mar 2009 08:46:04 +1100 1.1038 --- files.el 11 Mar 2009 09:14:14 +1100 *************** *** 5336,5345 **** (save-match-data (with-temp-buffer (when (and directory-free-space-program ! (eq 0 (call-process directory-free-space-program ! nil t nil ! directory-free-space-args ! dir))) ;; Usual format is a header line followed by a line of ;; numbers. (goto-char (point-min)) --- 5336,5346 ---- (save-match-data (with-temp-buffer (when (and directory-free-space-program ! (let ((default-directory "/")) ! (eq 0 (call-process directory-free-space-program ! nil t nil ! directory-free-space-args ! dir)))) ;; Usual format is a header line followed by a line of ;; numbers. (goto-char (point-min)) --=-=-=-- ------------=_1237084805-9137-1-- From unknown Sat Jun 21 12:35:34 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2631: get-free-disk-space when default-directory doesn't exist Reply-To: Kevin Ryde , 2631@debbugs.gnu.org Resent-From: Kevin Ryde Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 17 Mar 2009 00:10:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 2631 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 2631-submit@emacsbugs.donarmstrong.com id=B2631.123724817323749 (code B ref 2631); Tue, 17 Mar 2009 00:10:05 +0000 Received: (at 2631) by emacsbugs.donarmstrong.com; 17 Mar 2009 00:02:53 +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=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mailout1.pacific.net.au (mailout1-6.pacific.net.au [61.8.2.213]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2H02nS8023743 for <2631@emacsbugs.donarmstrong.com>; Mon, 16 Mar 2009 17:02:51 -0700 Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout1.pacific.net.au (Postfix) with ESMTP id 39581455499; Tue, 17 Mar 2009 11:02:47 +1100 (EST) Received: from blah.blah (ppp2309.dyn.pacific.net.au [61.8.35.9]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id A052B8C29; Tue, 17 Mar 2009 11:02:46 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1LjMlH-0001vM-5d; Tue, 17 Mar 2009 11:02:27 +1100 From: Kevin Ryde To: Chong Yidong Cc: 2631@debbugs.gnu.org References: <87d4cjzf89.fsf@cyd.mit.edu> Date: Tue, 17 Mar 2009 11:02:26 +1100 In-Reply-To: <87d4cjzf89.fsf@cyd.mit.edu> (Chong Yidong's message of "Sat, 14 Mar 2009 22:34:14 -0400") Message-ID: <877i2p9fu5.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Chong Yidong writes: > > default-directory to "~/" rather than "/" What is it that's not good about "/"? It doesn't have to be readable or anything I don't think, just somewhere capable of a chdir(). Wouldn't it be the only thing certain to work with chdir()? As I mentioned before there's other places using "/" for the same purpose if there's something wrong with it. Either way what I missed from my first post was that a change to default-directory ought to absolutize the given dir argument, so that say (get-free-disk-space ".") gives info about the original default-directory, not the mangled one. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=files.el.disk-space-expand.diff *** files.el 17 Mar 2009 10:35:50 +1100 1.1040 --- files.el 17 Mar 2009 10:53:40 +1100 *************** *** 5341,5346 **** --- 5341,5347 ---- (file-directory-p default-directory) (file-readable-p default-directory)) default-directory + (setq dir (expand-file-name dir)) (expand-file-name "~/")))) (eq (call-process directory-free-space-program nil t nil --=-=-=-- From unknown Sat Jun 21 12:35:34 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2631: get-free-disk-space when default-directory doesn't exist Reply-To: Eli Zaretskii , 2631@debbugs.gnu.org Resent-From: Eli Zaretskii Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 17 Mar 2009 04:15:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 2631 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 2631-submit@emacsbugs.donarmstrong.com id=B2631.123726271121715 (code B ref 2631); Tue, 17 Mar 2009 04:15:04 +0000 Received: (at 2631) by emacsbugs.donarmstrong.com; 17 Mar 2009 04:05:11 +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=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mtaout1.012.net.il (mtaout1.012.net.il [84.95.2.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2H456q9020187 for <2631@emacsbugs.donarmstrong.com>; Mon, 16 Mar 2009 21:05:08 -0700 Received: from conversion-daemon.i-mtaout1.012.net.il by i-mtaout1.012.net.il (HyperSendmail v2007.08) id <0KGM00300TRJ5500@i-mtaout1.012.net.il> for 2631@emacsbugs.donarmstrong.com; Tue, 17 Mar 2009 06:05:48 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.126.218.225]) by i-mtaout1.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KGM00FIWU1N7Z50@i-mtaout1.012.net.il>; Tue, 17 Mar 2009 06:05:48 +0200 (IST) Date: Tue, 17 Mar 2009 06:05:02 +0200 From: Eli Zaretskii In-reply-to: <877i2p9fu5.fsf@blah.blah> X-012-Sender: halo1@inter.net.il To: Kevin Ryde , 2631@debbugs.gnu.org Cc: cyd@stupidchicken.com Message-id: References: <87d4cjzf89.fsf@cyd.mit.edu> <877i2p9fu5.fsf@blah.blah> > From: Kevin Ryde > Date: Tue, 17 Mar 2009 11:02:26 +1100 > Cc: 2631@emacsbugs.donarmstrong.com > > > default-directory to "~/" rather than "/" > > What is it that's not good about "/"? It doesn't have to be readable or > anything I don't think, just somewhere capable of a chdir(). Doesn't chdir need certain rights? what if the user doesn't have them? > Either way what I missed from my first post was that a change to > default-directory ought to absolutize the given dir argument, so that > say > > (get-free-disk-space ".") > > gives info about the original default-directory, not the mangled one. What "mangled one"? From unknown Sat Jun 21 12:35:34 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2631: get-free-disk-space when default-directory doesn't exist Reply-To: Kevin Ryde , 2631@debbugs.gnu.org Resent-From: Kevin Ryde Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 27 Mar 2009 23:25:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 2631 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 2631-submit@emacsbugs.donarmstrong.com id=B2631.123819592310512 (code B ref 2631); Fri, 27 Mar 2009 23:25:04 +0000 Received: (at 2631) by emacsbugs.donarmstrong.com; 27 Mar 2009 23:18:43 +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=-4.9 required=4.0 tests=FOURLA,FVGT_m_MULTI_ODD, HAS_BUG_NUMBER,MURPHY_DRUGS_REL8,VALID_BTS_CONTROL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mailout1.pacific.net.au (mailout1-2.pacific.net.au [61.8.2.209]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2RNIXva010504; Fri, 27 Mar 2009 16:18:35 -0700 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id CA5DE469097; Sat, 28 Mar 2009 10:18:31 +1100 (EST) Received: from blah.blah (ppp203E.dyn.pacific.net.au [61.8.32.62]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id EF49927407; Sat, 28 Mar 2009 10:18:30 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1LnLJ7-0004Nz-PI; Sat, 28 Mar 2009 10:17:50 +1100 From: Kevin Ryde To: control@debbugs.gnu.org, 2631@debbugs.gnu.org References: <87d4cjzf89.fsf@cyd.mit.edu> <877i2p9fu5.fsf@blah.blah> Date: Sat, 28 Mar 2009 10:17:47 +1100 In-Reply-To: <877i2p9fu5.fsf@blah.blah> (Kevin Ryde's message of "Tue, 17 Mar 2009 11:02:26 +1100") Message-ID: <878wmqy2qs.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= reopen 2631 retitle 2631 get-free-disk-space when home dir also doesn't exist tags 2631 +patch thanks If both default-directory and home directory both don't exist get-free-disk-space still gets an error (progn (setq default-directory "/no/such/dir") (setenv "HOME" "/another/no/such/dir") (get-free-disk-space "/")) => (file-error "Setting current directory" "no such file or directory" "/another/no/such/dir/") Although plenty of things probably depend on a home dir I don't think get-free-disk-space needs to be one of them. Change below is like what's also in the following funcs, I believe for the same purpose, ie. just to make sure call-process will be happy, when the program run doesn't care about the current directory. Man-init-defvars, mail-source-movemail message-send-mail-with-sendmail sendmail-send-it gamegrid-add-score-with-update-game-score-1 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=files.el.disk-space-root.diff *** files.el 28 Mar 2009 09:50:47 +1100 1.1041 --- files.el 28 Mar 2009 09:56:48 +1100 *************** *** 5336,5352 **** (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)) --- 5336,5349 ---- (save-match-data (with-temp-buffer (when (and directory-free-space-program ! (progn ! (setq dir (expand-file-name dir)) ;; in case relative ! (let ((default-directory "/")) ! (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)) --=-=-=-- From unknown Sat Jun 21 12:35:34 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2631: get-free-disk-space when default-directory doesn't exist Reply-To: Kevin Ryde , 2631@debbugs.gnu.org Resent-From: Kevin Ryde Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 27 Mar 2009 23:40:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 2631 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch Received: via spool by 2631-submit@emacsbugs.donarmstrong.com id=B2631.123819680814450 (code B ref 2631); Fri, 27 Mar 2009 23:40:04 +0000 Received: (at 2631) by emacsbugs.donarmstrong.com; 27 Mar 2009 23:33:28 +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=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mailout2.pacific.net.au (mailout2-11.pacific.net.au [125.255.80.138]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2RNXPAO014444 for <2631@emacsbugs.donarmstrong.com>; Fri, 27 Mar 2009 16:33:26 -0700 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout2.pacific.net.au (Postfix) with ESMTP id 7B2191F185A; Sat, 28 Mar 2009 10:33:23 +1100 (EST) Received: from blah.blah (ppp203E.dyn.pacific.net.au [61.8.32.62]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 13A6227407; Sat, 28 Mar 2009 10:33:23 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1LnLXZ-00051y-Tj; Sat, 28 Mar 2009 10:32:45 +1100 From: Kevin Ryde To: Eli Zaretskii Cc: 2631@debbugs.gnu.org References: <87d4cjzf89.fsf@cyd.mit.edu> <877i2p9fu5.fsf@blah.blah> Date: Sat, 28 Mar 2009 10:32:45 +1100 In-Reply-To: (Eli Zaretskii's message of "Tue, 17 Mar 2009 06:05:02 +0200") Message-ID: <874oxey21u.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Eli Zaretskii writes: > > Doesn't chdir need certain rights? Only search perms in the parent directories leading to a given dir, I believe. I suppose the root dir could be unreadable/unsearchable too. Dunno what chdir would do in that case (I'm not brave enough to try it either!) but certainly if the root dir is unsearchable then no subdir can work. From unknown Sat Jun 21 12:35:34 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: Kevin Ryde Subject: bug#2631 closed by Chong Yidong (Re: get-free-disk-space when default-directory doesn't exist) Message-ID: References: <871vnclhoz.fsf@cyd.mit.edu> <87wsaxhv97.fsf@blah.blah> X-Emacs-PR-Message: they-closed 2631 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch Reply-To: 2631@debbugs.gnu.org Date: Sun, 16 Aug 2009 00:40:12 +0000 Content-Type: multipart/mixed; boundary="----------=_1250383212-19695-1" This is a multi-part message in MIME format... ------------=_1250383212-19695-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #2631: get-free-disk-space when home dir also doesn't exist It has been closed by Chong Yidong . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Chong Yidong by replying to this email. --=20 2631: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D2631 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1250383212-19695-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 2631-done) by emacsbugs.donarmstrong.com; 16 Aug 2009 00:33:55 +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.6 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7G0XrPo018728; Sat, 15 Aug 2009 17:33:54 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 69DA657E21C; Sat, 15 Aug 2009 20:34:52 -0400 (EDT) From: Chong Yidong To: Kevin Ryde Cc: 2631-done@debbugs.gnu.org, 3911-done@debbugs.gnu.org Subject: Re: get-free-disk-space when default-directory doesn't exist Date: Sat, 15 Aug 2009 20:34:52 -0400 Message-ID: <871vnclhoz.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > What is it that's not good about "/"? It doesn't have to be readable > or anything I don't think, just somewhere capable of a chdir()... If > both default-directory and home directory both don't exist > get-free-disk-space still gets an error You're right; it's probably better to fall back on / instead of ~. I've just checked in your suggested change. > (let ((default-directory "/no/such/dir")) > (get-free-disk-space ".")) > => 3705637 I checked in your suggestion to do expand-file-name before changing the default-directory, as well. Thanks. ------------=_1250383212-19695-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 10 Mar 2009 22:24:46 +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=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2AMOfL0028789 for ; Tue, 10 Mar 2009 15:24:43 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LhANN-0007jw-Lp for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 18:24:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LhANN-0007j3-0I for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 18:24:41 -0400 Received: from [199.232.76.173] (port=53023 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhANM-0007is-OR for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 18:24:40 -0400 Received: from mailout2-2.pacific.net.au ([61.8.2.225]:37345 helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LhANL-0005Kb-Rb for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2009 18:24:40 -0400 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout2.pacific.net.au (Postfix) with ESMTP id 020581B3FB0 for ; Wed, 11 Mar 2009 09:24:30 +1100 (EST) Received: from blah.blah (ppp26D7.dyn.pacific.net.au [61.8.38.215]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 0D4C027431 for ; Wed, 11 Mar 2009 09:24:28 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1LhAMn-0005hd-Kd for bug-gnu-emacs@gnu.org; Wed, 11 Mar 2009 09:24:05 +1100 From: Kevin Ryde To: bug-gnu-emacs@gnu.org Subject: get-free-disk-space when default-directory doesn't exist Date: Wed, 11 Mar 2009 09:24:04 +1100 Message-ID: <87wsaxhv97.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (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) --=-=-= Evaluating (with-temp-buffer (setq default-directory "/no/such/dir") (get-free-disk-space "/tmp")) gets an error (file-error "Setting current directory" "no such file or directory" "/no/such/dir") where I hoped it wouldn't care about default-directory, only the given directory argument. Perhaps a let-bind per below. In GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11) of 2008-11-10 on raven, modified by Debian configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs22:/etc/emacs:/usr/local/share/emacs/22.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/22.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/22.2/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' 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 locale-coding-system: iso-8859-1 default-enable-multibyte-characters: t --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=files.el.free-space.diff *** files.el 11 Mar 2009 08:46:04 +1100 1.1038 --- files.el 11 Mar 2009 09:14:14 +1100 *************** *** 5336,5345 **** (save-match-data (with-temp-buffer (when (and directory-free-space-program ! (eq 0 (call-process directory-free-space-program ! nil t nil ! directory-free-space-args ! dir))) ;; Usual format is a header line followed by a line of ;; numbers. (goto-char (point-min)) --- 5336,5346 ---- (save-match-data (with-temp-buffer (when (and directory-free-space-program ! (let ((default-directory "/")) ! (eq 0 (call-process directory-free-space-program ! nil t nil ! directory-free-space-args ! dir)))) ;; Usual format is a header line followed by a line of ;; numbers. (goto-char (point-min)) --=-=-=-- ------------=_1250383212-19695-1-- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 04 04:21:45 2011 Received: (at control) by debbugs.gnu.org; 4 Mar 2011 09:21:45 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PvRCi-0004OD-Oe for submit@debbugs.gnu.org; Fri, 04 Mar 2011 04:21:44 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PvRCh-0004O0-BP for control@debbugs.gnu.org; Fri, 04 Mar 2011 04:21:43 -0500 Received: from localhost ([127.0.0.1]:42418) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PvRCc-0003Ss-5k; Fri, 04 Mar 2011 04:21:38 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19824.44833.816623.443441@fencepost.gnu.org> Date: Fri, 4 Mar 2011 04:21:37 -0500 From: Glenn Morris To: control Subject: emacs X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: magenta X-Ran: L[A}.[}%S592P$,3~}HCxvVVivoWd3>H4]C3"4'aVrbg(8@b'0BeMzdE6cc@G29;5hmyIp X-Debbugs-No-Ack: yes X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) unarchive 2631 unarchive 3911 merge 2631 3911