aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii <[email protected]>2000-08-09 12:01:09 +0000
committerEli Zaretskii <[email protected]>2000-08-09 12:01:09 +0000
commit17ab9c39809786bf12eff03cf66974d4c77c3a00 (patch)
treeb69bb57e9e652c5a7990af5ee17b9b254c6b2a37
parentab3b1799ad12cbdc289786a6de5283a17986ec4b (diff)
(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 1a7ddb872c..3c78f4ba09 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'."
file))))))))
(if (/= result 0)
;; We get here if `insert-directory-program' failed.
- ;; Access the file to get a suitable error.
- (access-file file "Reading directory")
+ ;; On non-Posix systems, we cannot open a directory, so
+ ;; don't even try, because that will always result in
+ ;; the ubiquitous "Access denied". Instead, show them
+ ;; the `ls' command line and let them guess what went
+ ;; wrong.
+ (if (and (file-directory-p file)
+ (memq system-type '(ms-dos windows-nt)))
+ (error
+ "Reading directory: \"%s %s -- %s\" exited with status %s"
+ insert-directory-program
+ (if (listp switches) (concat switches) switches)
+ file result)
+ ;; Unix. Access the file to get a suitable error.
+ (access-file file "Reading directory"))
;; Replace "total" with "used", to avoid confusion.
;; Add in the amount of free space.
(save-excursion