From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Add a predicate for canonical file name Date: Mon, 12 Sep 2016 16:01:57 -0400 Message-ID: References: <838tux9h3c.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1473710960 3262 195.159.176.226 (12 Sep 2016 20:09:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Sep 2016 20:09:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 12 22:09:16 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjXXX-0000IM-CZ for ged-emacs-devel@m.gmane.org; Mon, 12 Sep 2016 22:09:15 +0200 Original-Received: from localhost ([::1]:44966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjXXV-0001WH-HK for ged-emacs-devel@m.gmane.org; Mon, 12 Sep 2016 16:09:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjXR2-0006UR-CR for emacs-devel@gnu.org; Mon, 12 Sep 2016 16:02:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjXQy-0002UZ-EJ for emacs-devel@gnu.org; Mon, 12 Sep 2016 16:02:32 -0400 Original-Received: from [195.159.176.226] (port=54874 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjXQy-0002SP-7F for emacs-devel@gnu.org; Mon, 12 Sep 2016 16:02:28 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bjXQf-0006y6-BG for emacs-devel@gnu.org; Mon, 12 Sep 2016 22:02:09 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:o1PSAQLnMSPUkD7QOZalYGCf2ho= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207399 Archived-At: > Using string= here will cause false negatives, e.g. with Windows file > names that use backslashes vs forward slashes, or due to letter-case > differences on case-insensitive file systems. Did you really mean > that? Indeed, such notions have already been requested and discussed here, and it's not clear exactly what is needed and when. I can see several different meanings of "canonical", i.e. representative member of an equivalence class (and I'd be inclined to prefer a function that checks for "equivalence" between two file names rather than a function that tries to find one canonical name). The equivalence classes could be: - equivalent regardless of the actual on-disk data. I.e. this can't take symlinks or hard links into account. Questions remain about whether it could presume the "normal semantics of the most common file-system". E.g. should it assume case-insensitive names in MacOS/Windows and case-sensitive in GNU/Linux? - equivalent in practice for the current state of the file-system. You can test this equivalence by comparing the output of `file-attributes', except when the name corresponds to a file that doesn't exist (yet?). Which flavor do you want? Stefan