[python-win32] GetVolumeInformation throwing exception
gustavotabares at gmail.com
Wed Jan 10 21:57:17 CET 2007
Hrm ok, so this:
only works if your current working directory isn't somewhere on that drive
(as in my example code)? The rest of the time you need to specify an
additional slash or to be safe always include the os separator.
On 1/10/07, Tim Roberts <timr at probo.com> wrote:
> 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
> / 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.
> Python-win32 mailing list
> Python-win32 at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-win32