Determining the volume ID for a file/drive?

Thomas Heller theller at python.net
Tue Apr 29 09:38:39 CEST 2003


carroll at tjc.com writes:

> Is there any way to determine the volume serial number for a disk,
> given the filename (or drive, since I can determine the drive from the
> filename with os.path.splitdrive(os.path.abspath(file))?
> 
> My environment is Windows & Python 2.2.2, and I don't need for my code
> to be portable. 

win32api.GetVolumeInformation("c:\\")




More information about the Python-list mailing list