[Distutils] New code snapshot
Corran Webster
cwebster@nevada.edu
Thu, 3 Aug 2000 00:02:38 -0700
At 9:30 PM -0400 2/8/00, Greg Ward wrote:
> On 01 August 2000, Corran Webster said:
> > Unfortunately, it seems like sometimes the trailing ":" is required. To
> > explain why, I need to explain a little bit more about mac pathnames. On
> > the mac, a path starting with a colon is relative, while one which doesn't
> > start with a colon is absolute (ie. the reverse of the posix convention),
> > _unless_ it's just a single name (ie. no colons whatsoever) in which case
> > it's relative. The end result of this is that "Macintosh HD" refers to a
> > file in the local directory called "Macintosh HD" (as does ":Macintosh
> > HD"), while "Macintosh HD:" refers to the root directory of the hard disk
> > "Macintosh HD".
> >
> > However, "Macintosh HD:Applications:" and "Macintosh HD:Applications" are
> > the same thing as each other. Similarly ":Macintosh HD:Applications:" and
> > ":Macintosh HD:Applications" are the same as each other.
>
> Ooh, tricky! Now I can see why Mac OS doesn't have a command-line
> interface: if users can't understand the difference between "/foo" and
> "foo", how on earth will they understand that "foo" == ":foo" != "foo:",
> while "foo:bar" == ":foo:bar" (but "foo:bar" == "foo:bar:" and
> ":foo:bar" == ":foo:bar:"). Aieee! Doesn't quite rival VMS for
> complexity, but it's getting there.
Actually it's
":foo" == "foo" != "foo:"
but
":foo:bar" != "foo:bar" == "foo:bar:"
> > There's a similar problem with ":", "::", etc. Removing a trailing ":" in
> > these cases directly affects the meaning.
> [...]
> > Having looked at this, I can see why Mac normpath can't just strip trailing
> > colons. However, the cases where we have to leave a trailing colon are
> > fairly easily identified (ie. paths which have just one ":" and it's at the
> > end should have the trailing colon left intact, as should paths which are
> > entirely colons...)
>
> Agreed. Sounds fairly straightforward to implement Mac OS' rules. I've
> glanced at the patch you mailed me privately and will comment in more
> detail when I respond to that.
For the record, I posted to the MacPython list about this, and it looks
like people are happy with the new version of os.path.normpath for the mac,
so hopefully that'll be in the CVS tree in a day or two (I'll send it to
Jack Jansen to add it to the tree).
Regards,
Corran