[Pythonmac-SIG] Referencing drive path names on OS9

Jack Jansen Jack.Jansen at cwi.nl
Wed Jul 7 11:03:26 CEST 2004


On 7 Jul 2004, at 05:56, Andrew Dufresne wrote:

> My appologies if this is a silly question but I have a question about 
> referencing drive paths on an OS9 version of macpython (2.3.3).
>  
> I understand that when macpython references folder paths on a drive 
> (be it the root drive, CDROM, removable media, etc.) you need to 
> specify the name of the drive for the absolute path specification.
> For example:
>       os.listdir('My Disk:Applications')
> to list the directory 'Applications' on the system hard disk (in this 
> case, named 'My Disk'). Thats all fine and dandy.
>  
> But what happens when you have two different disks that happen to have 
> the same name?

This is a general problem with using pathnames on MacOS9. According to 
the Apple specs you should be using FSRef's, FSSpec's or aliases to 
refer to files, not pathnames. For Python this means that a second disk 
with the same name is not visible to the Posix-compatible calls (open, 
os.chdir, many many more). If you use 100% Apple API calls (the 
FSspec/FSRef APIs mentioned above) there is no problem, though.

But in reality this appears to be a theoretical problem: I've never 
heard any Python user complain about this.
--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman



More information about the Pythonmac-SIG mailing list