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: "Mark J. Reed" <email@hidden>
- Date: Sun, 21 Dec 2008 08:17:09 -0500
The difference is that, in the case of "/", the slash isn't delimiting
anything - it is the only name that directory has. Because of that,
the canonical name for the root of the filesystem *always* has a
"trailing" slash. The canonical name for any other directory *never*
has a trailing slash (they are allowed, but extraneous).
This means that if "dir" is a variable containing the canonical POSIX
path to a directory, and "file" is a filename with no slashes, (dir &
"/" & file) will not always yield the canonical POSIX path of the
result. If dir is "/", then you wind up with "//filename". Not only
is that not canonical, but in some circumstances it's not even
correct, because the doubled slash changes the interpretation of the
path completely by introducing UNC or URL semantics.
But the question was about disk volumes. Chris said that HFS paths to
volumes have to have a trailing colon, and Axel pointed out that
(POSIX file "/Volumes/Foo" as text) yields bare "Foo" without the
trailing colon, which seems to disprove that statement. Although that
could just be a bug in AppleScript's stringification. I note that
(POSIX file "/Volumes/Foo" as file as text) does put the trailing
colon in.
_______________________________________________
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