[ANN] [UPDATES] Squeak 3.4 now in beta
Richard A. O'Keefe
ok at cs.otago.ac.nz
Thu Dec 5 00:23:24 UTC 2002
Ned Konz <ned at bike-nomad.com> asked:
What should the equivalent be for the following Unix path conventions:
/aVolume/anAbsolute/path
is this "aVolume:anAbsolute:path" ?
Yes.
aRelativePath/somewhere (a/k/a ./aRelativePath/somewhere)
is this ":aRelativePath/somewhere"?
No, it's
:aRelativePath:somewhere
../some/path/relative/to/the/parent
is this "::some:path:relative:to:the:parent"?
Yes.
../../some/other relative path
is this ":::some:other relative path"?
About here my MacOS knowledge runs out, but I think the answer is Yes.
So how do I test whether a path is relative or absolute? Obviously I
can check against subdirectories (presumably volumes) under the root,
but will this work in all cases?
If a path begins with a colon, it is relative.
Otherwise,
If it contains a colon anywhere, it is absolute and the first component
is the volume name.
Otherwise,
It is relative.
Inside Macintosh used to warn against over-reliance on absolute file
names for the reason that several discs can have the same volume name.
(For example, on one machine I've seen, the internal hard disc drive
is called 'Untitled', and so is any fresh floppy.)
The description for isAbsolute() in Perl's File::Spec::Mac is:
---
Takes as argument a path and returns true, if it is an absolute path.
If the path has a leading ":", it's a relative path. Otherwise, it's
an absolute path, unless the path doesn't contain any colons, i.e.
it's a name like "a". In this particular case, the path is considered
to be relative (i.e. it is considered to be a filename).
Right.
More information about the Squeak-dev
mailing list
|