[Pythonmac-SIG] Re: Determining the name of the "root" drive
Jack Jansen
Jack.Jansen@oratrix.com
Fri, 13 Sep 2002 21:14:59 +0200
On vrijdag, september 13, 2002, at 06:40 , Josh English wrote:
> Finally, one that even I can answer ; )
>
> try
>
>>>> os.getcwd().split(':')[0]
> 'Marvin'
>
> Marvin is the name of my hard drive.
Close, but no cigar. Your currrent directory doesn't have to be
on the startup disk.
The right way to tackle this (or, one of the right ways, as the
OSA example showed:-) is to ask where the current system folder
is, and use your code on that filename:
import macfs
vrefnum, dirid = macfs.FindFolder('macs')
fss = macfs.FSSpec(vrefnum, dirid, "")
bootdiskname = fss.as_pathname().split(':')[0]
--
- Jack Jansen <Jack.Jansen@oratrix.com>
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution --
Emma Goldman -