Hrm ok, so this:<br><br>win32api.GetVolumeInformation('F:')<br><br>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.
<br><br>Thanks,<br>Gus<br><br><br><div><span class="gmail_quote">On 1/10/07, <b class="gmail_sendername">Tim Roberts</b> <<a href="mailto:timr@probo.com">timr@probo.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Gustavo Tabares wrote:<br>><br>> I'm having a problem with the code below and I'm not sure if there is<br>> a bug in win32api.GetVolumeInformation. There is a simple workaround,<br>> but I'm curious nonetheless. Any help is appreciated.
<br>> ...<br>> The simple workaround is to add os.sep to the F: string in the last<br>> call to GetVolumeInformation; it runs properly. This also still breaks<br>> if you chdir back to the local C: drive.<br><br>
It's not a bug. When in doubt, always refer to the documentation. From<br><a href="http://msdn2.microsoft.com/en-us/library/aa364993.aspx">http://msdn2.microsoft.com/en-us/library/aa364993.aspx</a>:<br><br>/ lpRootPathName/
<br> [in] A pointer to a string that contains the root directory of the<br> volume to be described.<br><br> If this parameter is NULL, the root of the current directory is<br> used. A trailing backslash is required. For example, you specify
<br> \\MyServer\MyShare as \\MyServer\MyShare\, or the C drive as "C:\".<br><br>--<br>Tim Roberts, <a href="mailto:timr@probo.com">timr@probo.com</a><br>Providenza & Boekelheide, Inc.<br><br>_______________________________________________
<br>Python-win32 mailing list<br><a href="mailto:Python-win32@python.org">Python-win32@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/python-win32">http://mail.python.org/mailman/listinfo/python-win32</a>
<br></blockquote></div><br>