Function: eshell-file-attributes
eshell-file-attributes is a byte-compiled function defined in
esh-util.el.gz.
Signature
(eshell-file-attributes FILE &optional ID-FORMAT)
Documentation
Return the attributes of FILE, playing tricks if it's over ange-ftp.
The optional argument ID-FORMAT specifies the preferred uid and
gid format. Valid values are string and integer, defaulting to
integer. See file-attributes.
Source Code
;; Defined in /usr/src/emacs/lisp/eshell/esh-util.el.gz
(defun eshell-file-attributes (file &optional id-format)
"Return the attributes of FILE, playing tricks if it's over ange-ftp.
The optional argument ID-FORMAT specifies the preferred uid and
gid format. Valid values are `string' and `integer', defaulting to
`integer'. See `file-attributes'."
(let* ((file (expand-file-name file))
entry)
(if (string-equal (file-remote-p file 'method) "ftp")
(let ((base (file-name-nondirectory file))
(dir (file-name-directory file)))
(if (string-equal "" base) (setq base "."))
(unless entry
(setq entry (eshell-parse-ange-ls dir))
(if entry
(let ((fentry (assoc base (cdr entry))))
(if fentry
(setq entry (cdr fentry))
(setq entry nil)))))
entry)
(file-attributes file id-format))))