mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-24 13:57:36 +00:00
* lisp/net/tramp.el (tramp-handle-file-regular-p): Improve error handling.
This commit is contained in:
parent
2e92f176a3
commit
3cc06d1abb
1 changed files with 7 additions and 3 deletions
|
|
@ -3306,9 +3306,13 @@ User is always nil."
|
|||
(defun tramp-handle-file-regular-p (filename)
|
||||
"Like `file-regular-p' for Tramp files."
|
||||
(and (file-exists-p filename)
|
||||
(eq ?-
|
||||
(aref (tramp-compat-file-attribute-modes (file-attributes filename))
|
||||
0))))
|
||||
;; Sometimes, `file-attributes' does not return a proper value
|
||||
;; even if `file-exists-p' does.
|
||||
(ignore-errors
|
||||
(eq ?-
|
||||
(aref
|
||||
(tramp-compat-file-attribute-modes (file-attributes filename))
|
||||
0)))))
|
||||
|
||||
(defun tramp-handle-file-remote-p (filename &optional identification connected)
|
||||
"Like `file-remote-p' for Tramp files."
|
||||
|
|
|
|||
Loading…
Reference in a new issue