emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file-equal-p


From: Eli Zaretskii
Subject: Re: file-equal-p
Date: Fri, 17 Feb 2023 14:25:38 +0200

> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: Po Lu <luangruo@yahoo.com>,  emacs-devel@gnu.org
> Date: Fri, 17 Feb 2023 11:02:48 +0100
> 
> On Feb 16 2023, Richard Stallman wrote:
> 
> > If so, can Emacs examine it using that other way?
> 
> The right way to solve the issue is to only compare the inode and device
> numbers.  The other attributes (other than the type) can change any time
> for unrelated reasons, and do not define the identity of a file.

That depends on the semantics of "files are equal".  If the issue is
only whether two file names point to the same file's data, then yes,
using file-attribute-file-identifier is TRT.  But that is not the only
possible semantics of these tests.  It is therefore up to the
application to decide which API to use, IMO.

Of course, as long as the file is identified only by its name, race
condition is possible even if we only compare the inode and the device
number.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]