From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.devel Subject: Re: file-equal-p Date: Fri, 17 Feb 2023 13:45:57 +0100 Message-ID: References: <87a61es8fh.fsf.ref@yahoo.com> <87a61es8fh.fsf@yahoo.com> <87v8k06247.fsf@igel.home> <83ilg01nst.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kMct216Km6gwqQTx" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9102"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 17 13:47:30 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pT09B-00028o-E0 for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Feb 2023 13:47:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pT088-0000on-7b; Fri, 17 Feb 2023 07:46:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pT07r-0000n1-Gz for emacs-devel@gnu.org; Fri, 17 Feb 2023 07:46:07 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pT07l-0003jL-PR for emacs-devel@gnu.org; Fri, 17 Feb 2023 07:46:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=M0kLvRifHxDAP9Y+0PMX9AKk4lgCeN4e9Y6HmnIweI4=; b=tge/ubQu5tlLqntHB9SkQoGUPd W/cl4si+s4OVscR7YJUcYs2g8L7H0cinfM904gvkmL+5fyJJr14EDjifcVvIQKd0ameCgm+xMnMbq Gln84kVenM0qRnLBr7eFyoaQv0N5Jz59b05yTp7Kir9NZBePCzVadDJJmyM5I4d5FhLWtLvg5G6XN joh0IZRWr74gp7LEmVCP23nftFVauPCh/PniJq3hz0HZt8vaoX8iBUyN6UBdK9i14GSL/uLyLQEEd ILF4JNyDnc+IVGPsjqFCX4TDlqhn3jSEUHca9J31h6Er9msSUFRPashDENyTY5WNpzHxtuAGcwAeT HKheO6TA==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1pT07h-0001m8-1D for emacs-devel@gnu.org; Fri, 17 Feb 2023 13:45:57 +0100 Content-Disposition: inline In-Reply-To: <83ilg01nst.fsf@gnu.org> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303472 Archived-At: --kMct216Km6gwqQTx Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 17, 2023 at 02:25:38PM +0200, Eli Zaretskii wrote: > > From: Andreas Schwab > > Cc: Po Lu , emacs-devel@gnu.org > > Date: Fri, 17 Feb 2023 11:02:48 +0100 > >=20 > > On Feb 16 2023, Richard Stallman wrote: > >=20 > > > If so, can Emacs examine it using that other way? > >=20 > > 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. >=20 > 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. This is how I read `file-equal-p''s docstring [1] (coming from Lisp, I'd called it `file-eq-p', but hey :-) > 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. >=20 > 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. Identity is always difficult in a mutable world, yes. Cheers [1] Return non-nil if files FILE1 and FILE2 name the same file. --=20 t --kMct216Km6gwqQTx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCY+92+gAKCRAFyCz1etHa RhSiAJ9zofeJajGXSyk7RAwZmCKK9A4d4ACfT8nYuWU44oqtKwKCPtXly92HFRU= =FgJn -----END PGP SIGNATURE----- --kMct216Km6gwqQTx--