[Python-Dev] Re: os.path.commonprefix breakage (original) (raw)

Greg Ewing greg@cosc.canterbury.ac.nz
Fri, 18 Aug 2000 13:01:17 +1200 (NZST)


Thomas Wouters:

Bzzzt. This is unfortunately not true. Observe:

daemon2:~/python > rmdir perl/ rmdir: perl/: Is a directory

I'd say that's a bug in rmdir in whatever Unix you're using. Solaris doesn't have the problem:

s454% cd ~/tmp s454% mkdir foo s454% rmdir foo/ s454%

There's always room for a particular program to screw up. However, the usual principle in Unices is that trailing slashes are optional.

Note that the trailing slash is added by all tab-completing shells that I know.

This is for the convenience of the user, who is probably going to type another pathname component, and also to indicate that the object found is a directory. It makes sense in an interactive tool, but not necessarily in other places.

Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+