Re: HFS paths (was Tell Blocks Considered Harmful)
Re: HFS paths (was Tell Blocks Considered Harmful)
- Subject: Re: HFS paths (was Tell Blocks Considered Harmful)
- From: Axel Luttgens <email@hidden>
- Date: Sun, 21 Dec 2008 14:25:50 +0100
Le 21 déc. 08 à 13:15, KOENIG Yvan a écrit :
[...]
I'm not a pro
Nor am I... ;-)
so I may be wrong but I don't understand why the first slash would
can't have the behaviour of the late one when it is the unique slash
available.
Remember the Holy Books: "Les premiers seront les derniers".
When it is the unique slash, the one IS the current root directory
AND a path separator.
Yes, I hesitated on how to expose those matters, as there are at least
two ways to do so.
The most common way (the one I followed in my post) is to say that the
initial slash in
/path/to/some/item
just represents the root directory, the very special case being the
path reduced to
/
With such an interpretation, the initial slash *is* the root directory
and may not be confused with any other slash appearing in a path
string; moreover, the initial path then doesn't play the role of a
path separator at all.
But it could also be argued that the root directory, being unique, has
a very special name: the empty string (this of course makes sense only
if no other item in the filesystem may receive such a name). Moreover,
the root directory being not contained into another directory, an
absolute path must thus be interpreted as:
<name of root directory>/path/to/some/item
<empty string>/path/to/some/item
even if just written as:
/path/to/some/item
With such an interpretation, the initial slash (which, strictly
speaking, isn't the first piece of the path anymore), indeed plays the
role of a path separator.
But it is a very special slash anyway, as it is the one allowing to
indicate that one is starting at the root directory. And designating
the root directory by this path:
/
now appears as a mandatory notational artifact, because the root
directory can't be unambiguously specified by its name (the empty
string) alone; the latter path indeed shows a slash, but again that
slash is a very special one.
As a general rule, whichever interpretation is the preferred one, it
appears that an initial slash (if any) in a path string has a very
special status.
Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden