# HG changeset patch # User Eli Zaretskii # Date 965822469 0 # Node ID b0c302c3b20986d17ec3a1d598dede362c8d6923 # Parent b374051343170ac511ec1a382d9c424e2132a147 (insert-directory): Don't call access-file on directories on DOS and Windows. diff -r b37405134317 -r b0c302c3b209 lisp/files.el --- a/lisp/files.el Wed Aug 09 09:02:46 2000 +0000 +++ b/lisp/files.el Wed Aug 09 12:01:09 2000 +0000 @@ -3560,8 +3560,20 @@ 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