aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2000-08-09 12:01:09 +0000
committerEli Zaretskii2000-08-09 12:01:09 +0000
commit17ab9c39809786bf12eff03cf66974d4c77c3a00 (patch)
treeb69bb57e9e652c5a7990af5ee17b9b254c6b2a37
parentab3b1799ad12cbdc289786a6de5283a17986ec4b (diff)
downloademacs-17ab9c39809786bf12eff03cf66974d4c77c3a00.tar.gz
emacs-17ab9c39809786bf12eff03cf66974d4c77c3a00.zip
(insert-directory): Don't call access-file on
directories on DOS and Windows.
-rw-r--r--lisp/files.el16
1 files changed, 14 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 1a7ddb872cf..3c78f4ba099 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3560,8 +3560,20 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'."
3560 file)))))))) 3560 file))))))))
3561 (if (/= result 0) 3561 (if (/= result 0)
3562 ;; We get here if `insert-directory-program' failed. 3562 ;; We get here if `insert-directory-program' failed.
3563 ;; Access the file to get a suitable error. 3563 ;; On non-Posix systems, we cannot open a directory, so
3564 (access-file file "Reading directory") 3564 ;; don't even try, because that will always result in
3565 ;; the ubiquitous "Access denied". Instead, show them
3566 ;; the `ls' command line and let them guess what went
3567 ;; wrong.
3568 (if (and (file-directory-p file)
3569 (memq system-type '(ms-dos windows-nt)))
3570 (error
3571 "Reading directory: \"%s %s -- %s\" exited with status %s"
3572 insert-directory-program
3573 (if (listp switches) (concat switches) switches)
3574 file result)
3575 ;; Unix. Access the file to get a suitable error.
3576 (access-file file "Reading directory"))
3565 ;; Replace "total" with "used", to avoid confusion. 3577 ;; Replace "total" with "used", to avoid confusion.
3566 ;; Add in the amount of free space. 3578 ;; Add in the amount of free space.
3567 (save-excursion 3579 (save-excursion