I need a function to determine if a directory is a mount point for a drive. I found this code already which works well for linux:
def getmount(path):
path
Do you want to find the mount point or just determine if it is a mountpoint?
Regardless, as commented above, it is possible in WinXP to map a logical drive to a folder.
See here for details: http://www.modzone.dk/forums/showthread.php?threadid=278
I would try win32api.GetVolumeInformation
>>> import win32api
>>> win32api.GetVolumeInformation("C:\\")
('LABEL', 1280075370, 255, 459007, 'NTFS')
>>> win32api.GetVolumeInformation("D:\\")
('CD LABEL', 2137801086, 110, 524293, 'CDFS')
>>> win32api.GetVolumeInformation("C:\\TEST\\") # same as D:
('CD LABEL', 2137801086, 110, 524293, 'CDFS')
>>> win32api.GetVolumeInformation("\\\\servername\\share\\")
('LABEL', -994499922, 255, 11, 'NTFS')
>>> win32api.GetVolumeInformation("C:\\WINDOWS\\") # not a mount point
Traceback (most recent call last):
File "", line 1, in
pywintypes.error: (144, 'GetVolumeInformation', 'The directory is not a subdirectory of the root directory.')