scan WIN directories with UNC pathnames

Tim Golden tim.golden at viacom-outdoor.co.uk
Mon Jul 26 14:32:22 CEST 2004


[Thomas Rademacher]
| The methods os.path.isdir(pathname) and os.listdir(pathname) 
| work fine with pathname="\\\\servername\\path".
| But with the argument pathname="\\\\servername" the method
| os.path.isdir(pathname) returns 0 and the method 
| os.listdir(pathname) raises an exception.

Ummm... Unless I've misunderstood what you're saying, it's
because \\servername is *not* a valid path in win32: it's
just the server bit of a server-share UNC path. If you wanted
to treat the available shares on a windows server as though
they were subfolders of a drive of which the server is the
root, you could write a class or two to do it, but you'd
have to use *some* kind of additional module, whether
win32wnet, ctypes or wmi.

TJG


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________



More information about the Python-list mailing list