pathname issue with enough-namestring
Faré <[email protected]> Tue, 30 Aug 2005 22:53:33 -0400
| Newsgroups | gmane.lisp.steel-bank.devel,gmane.lisp.cmucl.devel,gmane.lisp.cmucl.general,gmane.lisp.openmcl.bugs |
|---|---|
| Message-ID | <[email protected]> |
I *think* that cmucl, sbcl and openmcl are wrong when they reply
(ENOUGH-NAMESTRING #P"/a/b/c" #P"/")
=> "/a/b/c"
instead of replying
=> "a/b/c"
like clisp and gcl do.
In < http://lisp.org/HyperSpec/Body/fun_namestrin_h-namestring.html >,
the Holy CLHS specifies:
enough-namestring returns an abbreviated namestring that is just
sufficient to identify the file named by pathname when considered
relative to the defaults. It is required that
(merge-pathnames (enough-namestring pathname defaults) defaults)
== (merge-pathnames (parse-namestring pathname nil defaults) defaults)
in all cases, and the result of enough-namestring is the shortest
reasonable string that will satisfy this criterion.
It seems to me that in this particular case, "a/b/c" is reasonable
enough, and thus must be preferred over "/a/b/c". But I'm not a
registered language lawyer.
In cl-launch, I'll work around this bug by using translate-pathname
with (merge-pathnames #"**/*.*" ...). I hope I'm not digging deeper...
Riastradh comments (about the cmucl and sbcl implementations):
I think you'd just need to take out the (> PREFIX-LEN 1) from
UNPARSE-UNIX-ENOUGH in order to fix this...in filesys.lisp.
Hope this helps,
[ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ]
Lie, n.:
A very poor substitute for the truth, but the only one
discovered to date.
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf