Luke Gorrie luke@bluetail.com writes:
Helmut Eller e9626484@stud3.tuwien.ac.at writes:
Alain.Picard@memetrics.com writes:
Eerily enough, this is one of the first bugs I ever fixed in ILISP as well. I must be the only person using logical pathnames... :-)
Fixed in CVS. Thanks!
Are you a pathname expert? Is it better to use translate-logical-pathname or truename?
Christophe Rhodes said that we should use translate-logical-pathname (in the SBCL backend).
"pathname expert". Don't make me laugh. (Don't make me start ranting, either).
There are two separate operations that one can do on CL pathnames in this context; conveniently, we can denote this by some kind of flowchart:
TRANSLATE-LOGICAL-PATHNAME TRUENAME
/----------\ /----------\ /------------\ | "Logical"|----/ | physical |----/ | "canonical"| | pathname | /----->| pathname | /----->| pathname | ----------/ ----------/ ------------/ | ^ ------------------------------------------/ TRUENAME
The bad thing about passing a logical pathname to emacs, as you've observed, is that it doesn't go down too well; generally, there isn't a file called SYS:SRC;CODE;FD-STREAMS.LISP anywhere lying around, and even if there is it's not usually the one you're looking for. So we need to do at least TRANSLATE-LOGICAL-PATHNAME.
As for TRUENAME, well, it might seem that getting some kind of canonical pathname out might be a good thing. Sadly, though, what "canonical" means is by no means clear. Some implementations treat that as resolving symlinks (but not hardlinks); some implementations don't; some implementations (ACL, in the patch series for 6.2) oscillate between the two. More importantly perhaps, TRUENAME will throw an error if it thinks that no such file exists on the filesystem, so at the very least your protocol needs to handle this. TRANSLATE-LOGICAL-PATHNAME should never throw an error if handed a string or pathname; if it finds no suitable logical host to translate from, it simply leaves the pathname alone.
I hope that clarifies things somewhat :-)
Cheers,
Christophe
PS: yeah, use T-L-P and let emacs do the rest. That's my advice.