[Python-Dev] PEP 355 status

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Oct 26 10:29:43 CEST 2006

Talin wrote:

> That's true of textual paths in general - i.e. even on unix, textual 
> paths aren't guaranteed to be unique or exist.

What I mean is that it's possible for two different
files to have the same pathname (since you can mount
two volumes with identical names at the same time, or
for a file to exist on disk yet not be accessible via
any pathname (because it would exceed 255 characters).
I'm not aware of any analogous situations in unix.

> Its been a while since I used classic MacOS - how do you handle things 
> like configuration files with path names in them?

True native classic MacOS software generally doesn't
use pathnames. Things like textual config files are
really a foreign concept to it. If you wanted to store
config info, you'd probably store an alias, which
points at the moral equivalent of the files inode
number, and use a GUI for editing it.

However all this is probably not very relevant now,
since as far as I know, classic MacOS is no longer
supported in current Python versions. I'm just
pointing out that the flexibility would be there
if any similarly offbeat platform needed to be
supported in the future.

>     # Or you can just use a format specifier for PEP 3101 string format:
>     print "Path in local system format is {0}".format( entry )
>     print "Path in NT format is {0:NT}".format( entry )
>     print "Path in OS X format is {0:OSX}".format( entry )

I don't think that expressing one platform's pathnames
in the format of another is something you can do in
general, e.g. going from Windows to Unix, what do you
do with the drive letter?

You can only really do it if you have some sort of
network file system connection, and then you need
more information than just the path in order to do
the translation.


More information about the Python-Dev mailing list