你想找到挂载点还是只是确定它是否是一个挂载点?
无论如何,如上所述,在 WinXP 中可以将逻辑驱动器映射到文件夹。
详情见这里: http ://www.modzone.dk/forums/showthread.php?threadid=278
我会尝试 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 "<stdin>", line 1, in <module>
pywintypes.error: (144, 'GetVolumeInformation', 'The directory is not a subdirectory of the root directory.')