Mercurial > emacs
comparison lisp/files.el @ 30706:b0c302c3b209
(insert-directory): Don't call access-file on
directories on DOS and Windows.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Wed, 09 Aug 2000 12:01:09 +0000 |
parents | 194b7f43b959 |
children | df4c120d3d81 |
comparison
equal
deleted
inserted
replaced
30705:b37405134317 | 30706:b0c302c3b209 |
---|---|
3558 (if full-directory-p | 3558 (if full-directory-p |
3559 (concat (file-name-as-directory file) ".") | 3559 (concat (file-name-as-directory file) ".") |
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 |
3568 (goto-char (point-min)) | 3580 (goto-char (point-min)) |
3569 (when (re-search-forward "^total" nil t) | 3581 (when (re-search-forward "^total" nil t) |