emacs-devel
[Top][All Lists]
Advanced

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

file-truename, convert-standard-filename


From: Drew Adams
Subject: file-truename, convert-standard-filename
Date: Fri, 5 Feb 2010 09:31:54 -0800

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.)





reply via email to

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