Re: logical pathname help
- From: "John Thingstad" <john.thingstad@xxxxxxxxx>
- Date: Wed, 06 Dec 2006 22:32:08 +0100
On Wed, 06 Dec 2006 20:57:03 +0100, Thomas A. Russ <tar@xxxxxxxxxxxxx> wrote:
Pascal Bourguignon <pjb@xxxxxxxxxxxxxxxxx> writes:
Nobody complains that a CL pathname operation gives different results
on a different file system.
What we complain, is that two different implementations on the same OS
with the same file system give different results.
But when does this happen?
a) When using standard MAKE-PATHNAME and friends?
b) When using logical pathnames according to the standard, limited to
using only uppdercase letters, digits and hyphens?
c) When using logical pathnames not according to the standard, but with
some implementation-defined extension?
It is certainly the case that the logical-pathname translations work
differently on different lisp implementations, which effectively means
that even on the same platform, you may need separate translation
declarations depending on the lisp implementation.
To sum up a few things I figured out:
There is no way to generalize the production of all direcories on all
platforms in all compilers.
However it helps matters in common cases.
Here is a example of a common use:
(defparameter *game-help-directory*
(merge-pathnames
(make-pathname :directory '(:RELATIVE "game" "help"))
(user-homedir-pathname)))
All standard ANSI CL.
Works at least on Windows and Unix and under ACL and LispWorks.
Here I build on the last example:
(defun game-help (subject)
(check-type subject string)
(let ((filename (merge-pathnames
(make-pathname :name subject :type "hlp")
*game-help-directory*)))
(dump-file filename)))
A bit more verbose than I would like but workable.
Here is the biggest discrepancy under windows.
For Lispworks:
(pathname-host (user-homedir-pathname)) -> C
For the others:
(pathname-device (user-homedir-pathname)) -> C
So take care if reading from DVD/CDROM say.
Compilers tend to return (pathname-host ..) -> nil even though that is questionable
under the standard.
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
.
- References:
- logical pathname help
- From: Takehiko Abe
- Re: logical pathname help
- From: Richard M Kreuter
- Re: logical pathname help
- From: Takehiko Abe
- Re: logical pathname help
- From: Rainer Joswig
- Re: logical pathname help
- From: Pascal Bourguignon
- Re: logical pathname help
- From: Thomas A. Russ
- logical pathname help
- Prev by Date: Re: flattening a nested list functionally
- Next by Date: Re: Some of Ron's Code?
- Previous by thread: Re: logical pathname help
- Next by thread: Re: logical pathname help
- Index(es):
Relevant Pages
|