Function: tramp-sh-handle-file-attributes

tramp-sh-handle-file-attributes is a byte-compiled function defined in tramp-sh.el.gz.

Signature

(tramp-sh-handle-file-attributes FILENAME &optional ID-FORMAT)

Documentation

Like file-attributes for Tramp files.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
(defun tramp-sh-handle-file-attributes (filename &optional id-format)
  "Like `file-attributes' for Tramp files."
  ;; The result is cached in `tramp-convert-file-attributes'.
  ;; Don't modify `last-coding-system-used' by accident.
  (let ((last-coding-system-used last-coding-system-used))
    (with-parsed-tramp-file-name (expand-file-name filename) nil
      (tramp-convert-file-attributes v localname id-format
	(cond
	 ((tramp-get-remote-stat v)
	  (tramp-do-file-attributes-with-stat v localname))
	 ((tramp-get-remote-perl v)
	  (tramp-do-file-attributes-with-perl v localname))
	 (t (tramp-do-file-attributes-with-ls v localname)))))))