bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#3911: marked as done (get-free-disk-space race condition on default-


From: Emacs bug Tracking System
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

Your message dated Fri, 02 Oct 2009 10:24:49 +1000
with message-id <address@hidden>
and subject line Re: bug#3911: get-free-disk-space when default-directory 
doesn'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 address@hidden
immediately.)


-- 
3911: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3911
Emacs Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 23.1.50; get-free-disk-space relative to non-existent default-directory Date: Fri, 24 Jul 2009 08:19:54 +1000 User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.3 (gnu/linux)
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  <address@hidden>

        * files.el (get-free-disk-space): Absolutize the dir before
        changing default-directory, so as not to answer about a different
        directory.

*** 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

--- End Message ---
--- Begin Message --- Subject: Re: bug#3911: get-free-disk-space when default-directory doesn't exist Date: Fri, 02 Oct 2009 10:24:49 +1000 User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)
Installed by Stefan.

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]