GNU bug report logs - #2631
get-free-disk-space when home dir also doesn't exist

Previous Next

Package: emacs;

Reported by: Kevin Ryde <user42 <at> zip.com.au>

Date: Tue, 10 Mar 2009 22:30:03 UTC

Severity: normal

Tags: patch

Merged with 3911

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (Emacs bug Tracking System)
To: Chong Yidong <cyd <at> stupidchicken.com>
Subject: bug#2631: marked as done (get-free-disk-space when 
 default-directory doesn't exist)
Date: Sun, 15 Mar 2009 02:40:05 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 14 Mar 2009 22:34:14 -0400
with message-id <87d4cjzf89.fsf <at> cyd.mit.edu>
and subject line Re: bug#2631: get-free-disk-space when default-directory doesn't exist
has caused the Emacs bug report #2631,
regarding get-free-disk-space when default-directory doesn't exist
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 help-debbugs <at> gnu.org
immediately.)


-- 
2631: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2631
Emacs Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Kevin Ryde <user42 <at> zip.com.au>
To: bug-gnu-emacs <at> gnu.org
Subject: get-free-disk-space when default-directory doesn't exist
Date: Wed, 11 Mar 2009 09:24:04 +1100
[Message part 3 (text/plain, inline)]
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


[files.el.free-space.diff (text/x-diff, inline)]
*** 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))
[Message part 5 (message/rfc822, inline)]
From: Chong Yidong <cyd <at> stupidchicken.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Kevin Ryde <user42 <at> zip.com.au>, Eli Zaretskii <eliz <at> gnu.org>,
        2631-done <at> 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
Stefan Monnier <monnier <at> iro.umontreal.ca> 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.


This bug report was last modified 14 years and 84 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.