[Peter Hansen wrote] > Richard Lewis wrote: > > If you want to know where a particular directory is (on a Windows > > 'drive') you could use: > > > > for drive_label in ["C", "D"]: > > if "Program Files" in os.listdir(drive_label + ":/"): return > > drive_label > > This would cause trouble in at least two cases that I've seen. One was > a multiboot machine that had Windows 2000 on D: and Windows XP on C:. > The other was a machine that had the Program Files folder copied, for > reasons I don't recall (and perhaps only temporarily), to the D: drive.
And on non-English locales the folder name isn't actually "Program Files". And on some 64-bit architectures you can have "Program Files" and "Program Files (x86)". :) > Use one of the defined APIs for getting this information, not a hack > like this please. Amen. Trent -- Trent Mick [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list