Re: parse-namestring and logical pathnames



* (Pascal J. Bourguignon) <87vdwgr5qp.fsf@xxxxxxxxxxxxxxxxxxxxxxxx> :
Wrote on Sun, 28 Sep 2008 11:15:26 +0200:

| Madhu <enometh@xxxxxxxx> writes:
|
|> * (Pascal J. Bourguignon) <87bpyat7kq.fsf@xxxxxxxxxxxxxxxxxxxxxxxx> :
|> Wrote on Sat, 27 Sep 2008 08:40:37 +0200:
|> |
|> | I fail to see the point of using logical pathname if it is not to do
|> | it in a manner that is strictly and portably standard conformant.
|>
|> There may be NO WAY to do this; Especially if TRANSLATE-LOGICAL-PATHNAME
|> is required and you use uppercase in your logical pathname strings.
|
| Yes. Just use only logical pathname to both write and read the file
| system, never try to access any other file (with logical pathnames).

I disagree with this. Rainer is on the dot here.

| I know this allegro specific behavior.
|
| If you're after ~/foo.lisp, you shouldn't use logical pathnames.

Thats nonsense. The whole point is to define a translation to access
physical pathnames using logical pathnames. I can define the mapping of
"HOME:foo.lisp" => "~/foo.lisp" inside the translations.

The specific scenario you suggest where an application will want to 1)
create files and 2) only read those created files and no others are
comparitively few. All that can be said is that LPNs in the spec cover
this scenario.

|> * (lisp-implementation-version)
|>
|> => "8.1 [Linux (x86)] (Aug 9, 2008 1:00)"
|>
|> This is not a bug in Allegro.
|>
|> Function TRANSLATE-LOGICAL-PATHNAME
|> ,----
|> | translate-logical-pathname might perform additional translations,
|> | typically to provide translation of file types to local naming
|> | conventions, to accomodate physical file systems with limited length
|> | names, or to deal with special character requirements such as
|> | translating hyphens to underscores or uppercase letters to
|> | lowercase. Any such additional translations are
|> | implementation-defined. Some implementations do no additional
|> | translations.
|> `----
|>
|> So. if you think using uppercase is a necessary condition to ensure
|> portability (while ensuring it works!), you are mistaken :)
|
| No. What it implies is that you shouldn't use logical pathname to
| access portably random files created outside of lisp.
|
| Notice how an implementation is allowed to apply rot13 or anything
| else as silly (such as not mapping uppercase to lowercase on unix) to
| the logical pathname when it translates them.

Note: Allegro is the only implementation that does NOT frob the case of
the specified pathname in ANY WAY. I find that useful behaviour. The
fact that other implementations frob the name during translation is the
problem[1].

| If you want to use logical-pathname portably, then you can use them
| only to access files you created from same lisp, with same logical
| pathnames.

I'm unable coming up with enough sarcasm to parody this meaning of
"strictly and portably standard conformant", so I'll leave it at that
--
Madhu :)

[1] imo because they misweigh the imporatance of what the says about
uppercase in the implementation choices open to them.
.