Function: tramp-handle-file-regular-p

tramp-handle-file-regular-p is a byte-compiled function defined in tramp.el.gz.

Signature

(tramp-handle-file-regular-p FILENAME)

Documentation

Like file-regular-p for Tramp files.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
(defun tramp-handle-file-regular-p (filename)
  "Like `file-regular-p' for Tramp files."
  (and (file-exists-p filename)
       ;; Sometimes, `file-attributes' does not return a proper value
       ;; even if `file-exists-p' does.  Protect by `ignore-errors',
       ;; because `file-truename' could raise an error for cyclic
       ;; symlinks.
       (ignore-errors
	 (when-let* ((attr (file-attributes filename)))
	   (cond
	    ((eq ?- (aref (file-attribute-modes attr) 0)))
	    ((eq ?l (aref (file-attribute-modes attr) 0))
	     (file-regular-p (file-truename filename))))))))