[python-win32] GetVolumeInformation throwing exception
Tim Roberts
timr at probo.com
Wed Jan 10 21:44:26 CET 2007
Gustavo Tabares wrote:
>
> I'm having a problem with the code below and I'm not sure if there is
> a bug in win32api.GetVolumeInformation. There is a simple workaround,
> but I'm curious nonetheless. Any help is appreciated.
> ...
> The simple workaround is to add os.sep to the F: string in the last
> call to GetVolumeInformation; it runs properly. This also still breaks
> if you chdir back to the local C: drive.
It's not a bug. When in doubt, always refer to the documentation. From
http://msdn2.microsoft.com/en-us/library/aa364993.aspx:
/ lpRootPathName/
[in] A pointer to a string that contains the root directory of the
volume to be described.
If this parameter is NULL, the root of the current directory is
used. A trailing backslash is required. For example, you specify
\\MyServer\MyShare as \\MyServer\MyShare\, or the C drive as "C:\".
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the Python-win32
mailing list