changeset 75552:4144cd078a1d

* files.el (get-free-disk-space): Return nil for remote directories. * net/ange-ftp.el (ange-ftp-ls): In case of wildcards, use "ls" instead of "dir".
author Michael Albinus <michael.albinus@gmx.de>
date Tue, 30 Jan 2007 20:23:38 +0000
parents acad3d4a5f18
children 2a21a7f5e91c
files lisp/ChangeLog lisp/files.el lisp/net/ange-ftp.el
diffstat 3 files changed, 37 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Jan 30 19:36:41 2007 +0000
+++ b/lisp/ChangeLog	Tue Jan 30 20:23:38 2007 +0000
@@ -1,3 +1,11 @@
+2007-01-30  Michael Albinus  <michael.albinus@gmx.de>
+
+	* files.el (get-free-disk-space): Return nil for remote
+	directories.
+
+	* net/ange-ftp.el (ange-ftp-ls): In case of wildcards, use "ls"
+	instead of "dir".
+
 2007-01-30  Chong Yidong  <cyd@stupidchicken.com>
 
 	* type-break.el (type-break-catch-up-event): New function.
--- a/lisp/files.el	Tue Jan 30 19:36:41 2007 +0000
+++ b/lisp/files.el	Tue Jan 30 20:23:38 2007 +0000
@@ -4749,36 +4749,37 @@
   "Return the amount of free space on directory DIR's file system.
 The result is a string that gives the number of free 1KB blocks,
 or nil if the system call or the program which retrieve the information
-fail.
+fail.  It returns also nil when DIR is a remote directory.
 
 This function calls `file-system-info' if it is available, or invokes the
 program specified by `directory-free-space-program' if that is non-nil."
-  ;; Try to find the number of free blocks.  Non-Posix systems don't
-  ;; always have df, but might have an equivalent system call.
-  (if (fboundp 'file-system-info)
-      (let ((fsinfo (file-system-info dir)))
-	(if fsinfo
-	    (format "%.0f" (/ (nth 2 fsinfo) 1024))))
-    (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))
-	  (forward-line 1)
-	  (if (not (eobp))
-	      (progn
-		;; Move to the end of the "available blocks" number.
-		(skip-chars-forward "^ \t")
-		(forward-word 3)
-		;; Copy it into AVAILABLE.
-		(let ((end (point)))
-		  (forward-word -1)
-		  (buffer-substring (point) end)))))))))
+  (when (not (file-remote-p dir))
+    ;; Try to find the number of free blocks.  Non-Posix systems don't
+    ;; always have df, but might have an equivalent system call.
+    (if (fboundp 'file-system-info)
+	(let ((fsinfo (file-system-info dir)))
+	  (if fsinfo
+	      (format "%.0f" (/ (nth 2 fsinfo) 1024))))
+      (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))
+	    (forward-line 1)
+	    (if (not (eobp))
+		(progn
+		  ;; Move to the end of the "available blocks" number.
+		  (skip-chars-forward "^ \t")
+		  (forward-word 3)
+		  ;; Copy it into AVAILABLE.
+		  (let ((end (point)))
+		    (forward-word -1)
+		    (buffer-substring (point) end))))))))))
 
 ;; The following expression replaces `dired-move-to-filename-regexp'.
 (defvar directory-listing-before-filename-regexp
--- a/lisp/net/ange-ftp.el	Tue Jan 30 19:36:41 2007 +0000
+++ b/lisp/net/ange-ftp.el	Tue Jan 30 20:23:38 2007 +0000
@@ -2599,7 +2599,7 @@
 	    (if wildcard
 		(progn
 		  (ange-ftp-cd host user (file-name-directory name))
-		  (setq lscmd (list 'dir file temp lsargs)))
+		  (setq lscmd (list 'ls file temp lsargs)))
 	      (setq lscmd (list 'dir name temp lsargs)))
 	    (unwind-protect
 		(if (car (setq result (ange-ftp-send-cmd