> > > Is there a way to differentiate between floppy, network, hard drive, > removable (aka USB flash) > drives? though Pythonwin? > > My searches came up with Tim Golden's mapped drives, which is somewhat > helpful, but not > particular to my needs. > http://tgolden.sc.sabren.com/python/win32_how_do_i/show_mapped_drives.html > > win32api.GetVolumeInformation doesn't return anything specific- other than > 'FAT' which is used > on a floppy, but somehow > I was expecting something a little more specific. How about (untried but ...)
drivebits=win32file.GetLogicalDrives() for d in range(1,26): mask=1 << d if drivebits & mask: # here if the drive is at least there drname='%c:\\' % chr(ord('A')+d) t=win32file.GetDriveType(drname) if t == win32file.DRIVE_REMOVABLE: Or whatever DRIVE_* defined values there are in win32file DRIVE_CDROM DRIVE_FIXED DRIVE_NO_ROOT_DIR DRIVE_RAMDISK DRIVE_REMOTE DRIVE_REMOVABLE DRIVE_UNKNOWN -- Howard Lightstone www.eegsoftware.com [EMAIL PROTECTED]
_______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32