[python-win32] Volume Serial Number

Tim Roberts timr at probo.com
Fri May 16 21:58:26 CEST 2008


Tony Cappellini wrote:
> >>Tim Golden has a way to do just about everything, but this particular
> >>snippet has nothing to do with the original question.
>
> def get_unique_id (hFile):
>   (
>     attributes,
>
>     created_at, accessed_at, written_at,
>     volume,
>     file_hi, file_lo,
>     n_links,
>     index_hi, index_lo
>   ) = win32file.GetFileInformationByHandle (hFile)
>   return volume, index_hi, index_lo
>
> The link I posted certainly has a misleading name, but the code above (from that link) returns the volume SN.
> Is the fifth item returned from GetFileInformationByHandle() not the Volume SN? 
>   

You are quite correct, I apologize.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list