From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: file-truename, convert-standard-filename Date: Fri, 5 Feb 2010 09:31:54 -0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1265392328 27246 80.91.229.12 (5 Feb 2010 17:52:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Feb 2010 17:52:08 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 05 18:52:06 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NdSLd-00020X-7b for ged-emacs-devel@m.gmane.org; Fri, 05 Feb 2010 18:52:05 +0100 Original-Received: from localhost ([127.0.0.1]:46934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NdSLc-0004mc-LK for ged-emacs-devel@m.gmane.org; Fri, 05 Feb 2010 12:52:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NdS31-0008UL-3j for emacs-devel@gnu.org; Fri, 05 Feb 2010 12:32:51 -0500 Original-Received: from [199.232.76.173] (port=37828 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NdS30-0008TV-Ij for emacs-devel@gnu.org; Fri, 05 Feb 2010 12:32:50 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NdS2y-0001bI-CY for emacs-devel@gnu.org; Fri, 05 Feb 2010 12:32:50 -0500 Original-Received: from acsinet11.oracle.com ([141.146.126.233]:24006) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NdS2x-0001a8-U4 for emacs-devel@gnu.org; Fri, 05 Feb 2010 12:32:48 -0500 Original-Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by acsinet11.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o15HWY4n028803 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 5 Feb 2010 17:32:40 GMT Original-Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o15HWXm5006388 for ; Fri, 5 Feb 2010 17:32:33 GMT Original-Received: from abhmt015.oracle.com by acsmt355.oracle.com with ESMTP id 13588461265391113; Fri, 05 Feb 2010 09:31:53 -0800 Original-Received: from dradamslap1 (/141.144.80.40) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 05 Feb 2010 09:31:53 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcqmiRv8z0kjlCHATgqiC4ARzhTJ9A== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt353.oracle.com [141.146.40.153] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090209.4B6C5632.0086:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:120944 Archived-At: It's not clear to me when to use `file-truename' and `convert-standard-filename'. I understand from the doc that: * f-t gives a name that results from following symlinks (including through ancestor dirs). * c-s-f gives a file name that fits the current OS. (So if a name is intended to be independent of a particular OS, it should not be the result of calling c-s-f.) But in terms of use, if I want to, say, compare two file names to see if they represent the same file, what's typically appropriate? Grepping the Emacs sources didn't make any guidelines jump to my eyes. For defcustoms, for instance, sometimes f-t is used; sometimes c-s-f is used. I didn't notice any places in the sources where both were used together. But in my ignorance and confusion, I'm trying this: (string= (convert-standard-filename (file-truename file1)) (convert-standard-filename (file-truename file2))) (There are no predefined file-name equality predicates, are there?) I'm sure there's a deeper level of identity that really compares the files themselves - by inode or whatever. But I'm really looking just to compare names of some kind, without accessing the files themselves. (I'm posting this here instead of help-gnu-emacs because I'm guessing that maybe the doc could be improved a bit to help with this.)