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

Re: [MacPerl] Q: last ":" in a file path



Chris Nandor wrote:
>At 01.03 1/3/98, Xah Lee wrote:
>>Can we say that the last ":" has absolutely no meaning in MacPerl?
>
>Pretty much, yes.  I have never known it to have meaning, that is.
>

"foo:" is a volume named foo
"foo" is a file <or directory> named foo in the current directory (as is
":foo").

MacPerl *shouldn't* disambiguate the latter case to the former if there is
a volume foo, since you might WANT the file foo in the current directory.
I don't know whether it does.

That's the only case I can think of where the trailing : should matter,
given that MacPerl figures out that
"bar:baz"
is a directory when it in fact is.

But...always using the trailing : has the advantage mentioned by Paul (it's
easier to avoid accidental :: <or accidental concatenation without one :>
when building paths).


One might prefer that HFS had used Unix-like rules (this one would, anyhow).

But Apple was pretty much stuck, since existing code when HFS came out
"knew" that volumes were "foo:", files in the current directory were "foo",
and regardless of the seeming directory structure (which was a figment of
Finder's imagination)
"foo:bar"
was a file on the disk foo.  Those were the only pre-HFS choices.  (You
could extort a folder id from Finder if you really wanted, to find out
where the user thought the file was, and I think you could set it.  So long
ago!)

  --John

--
John Baxter (Born before ENIAC, but not by much.)
   jwblist@olympus.net      Port Ludlow, WA, USA



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch