Function: url-file-attributes

url-file-attributes is a byte-compiled function defined in url-handlers.el.gz.

Signature

(url-file-attributes FILENAME &optional ID-FORMAT)

Documentation

URL file-name-handler wrapper for file-attributes call.

---
Return a list of attributes of file FILENAME. Value is nil if specified file does not exist.

ID-FORMAT specifies the preferred format of attributes uid and gid (see below) - valid values are string and integer. The latter is the default, but we plan to change that, so you should specify a non-nil value for ID-FORMAT if you use the returned uid or gid.

To access the elements returned, the following access functions are provided: file-attribute-type, file-attribute-link-number, file-attribute-user-id, file-attribute-group-id, file-attribute-access-time, file-attribute-modification-time, file-attribute-status-change-time, file-attribute-size, file-attribute-modes, file-attribute-inode-number, and file-attribute-device-number.

Elements of the attribute list are:
 0. t for directory, string (name linked to) for symbolic link, or nil.
 1. Number of links to file.
 2. File uid as a string or (if ID-FORMAT is integer or a string value
  cannot be looked up) as an integer.
 3. File gid, likewise.
 4. Last access time, in the style of current-time.
  (See a note below about access time on FAT-based filesystems.)
 5. Last modification time, likewise. This is the time of the last
  change to the file's contents.
 6. Last status change time, likewise. This is the time of last change
  to the file's attributes: owner and group, access mode bits, etc.
 7. Size in bytes, as an integer.
 8. File modes, as a string of ten letters or dashes as in ls -l.
 9. An unspecified value, present only for backward compatibility.
10. inode number, as a nonnegative integer.
11. Filesystem device number, as an integer.

Large integers are bignums, so eq might not work on them. On most filesystems, the combination of the inode and the device number uniquely identifies the file.

On MS-Windows, performance depends on w32-get-true-file-attributes, which see.

On some FAT-based filesystems, only the date of last access is recorded, so last access time will always be midnight of that day.

Source Code

;; Defined in /usr/src/emacs/lisp/url/url-handlers.el.gz
(url-handlers-create-wrapper file-attributes (url &optional id-format))