The file's inode and device together give enough information
to distinguish any two files on the system---no two files can have the
same values for both of these attributes. This tuple that uniquely
-identifies the file is returned by @code{file-attribute-file-number}.
+identifies the file is returned by @code{file-attribute-file-identifier}.
For example, here are the file attributes for @file{files.texi}:
* Lisp Changes in Emacs 29.1
+++
-** New accessor function 'file-attribute-file-number'.
+** New accessor function 'file-attribute-file-identifier'.
It returns the list of the inode number and device identifier
retrieved by 'file-attributes'. This value can be used to identify a
file uniquely. The device identifier can be a single number or (for
(file-attribute-inode-number attr)
(file-attribute-device-number attr-target)
(file-attribute-device-number attr)
- (equal (file-attribute-file-number attr-target)
- (file-attribute-file-number attr)))
+ (equal (file-attribute-file-identifier attr-target)
+ (file-attribute-file-identifier attr)))
(eshell-error (format-message "%s: `%s' and `%s' are the same file\n"
command (car files) target)))
(t
(setq list (cdr list)))
found)
(let* ((attributes (file-attributes truename))
- (number (file-attribute-file-number attributes))
+ (number (file-attribute-file-identifier attributes))
(list (buffer-list)) found)
(and buffer-file-numbers-unique
(car-safe number) ;Make sure the inode is not just nil.
(let* ((buf (get-file-buffer filename))
(truename (abbreviate-file-name (file-truename filename)))
(attributes (file-attributes truename))
- (number (file-attribute-file-number attributes))
+ (number (file-attribute-file-identifier attributes))
;; Find any buffer for a file that has same truename.
(other (and (not buf)
(find-buffer-visiting
(setq buffer-file-name truename))))
(setq buffer-file-number
(if filename
- (file-attribute-file-number (file-attributes buffer-file-name))
+ (file-attribute-file-identifier (file-attributes buffer-file-name))
nil))
;; write-file-functions is normally used for things like ftp-find-file
;; that visit things that are not local files as if they were files.
(setq save-buffer-coding-system last-coding-system-used)
(setq buffer-file-coding-system last-coding-system-used))
(setq buffer-file-number
- (file-attribute-file-number (file-attributes buffer-file-name)))
+ (file-attribute-file-identifier
+ (file-attributes buffer-file-name)))
(if setmodes
(condition-case ()
(progn
It is an integer or a cons cell of integers."
(nth 11 attributes))
-(defsubst file-attribute-file-number (attributes)
+(defsubst file-attribute-file-identifier (attributes)
"The inode and device numbers in ATTRIBUTES returned by `file-attributes'.
The value is a list of the form (INODENUM DEVICE), where DEVICE could be
either a single number or a cons cell of two numbers.
;; The Windows version doesn't report meaningful inode numbers, so
;; use the canonicalized absolute file name of the directory instead.
(setq attrs (or canonicalized
- (file-attribute-file-number (file-attributes this-dir))))
+ (file-attribute-file-identifier
+ (file-attributes this-dir))))
(unless (member attrs normal-top-level-add-subdirs-inode-list)
(push attrs normal-top-level-add-subdirs-inode-list)
(dolist (file contents)
Large integers are bignums, so `eq' might not work on them.
On most filesystems, the combination of the inode and the device
identifier uniquely identifies the file. This unique file identification
-is provided by the access function `file-attribute-file-number'.
+is provided by the access function `file-attribute-file-identifier'.
On MS-Windows, performance depends on `w32-get-true-file-attributes',
which see.