find network drives, win

Marcus Stojek stojek at part-gmbh.de
Mon Nov 5 17:51:10 CET 2001


Hi,

under windows I have to find out for a given path whether 
the drive is local or a network drive (is "mounted" the right word for
this?)
I tried:
-----------------------------------------------
import string
import os.path

lok=[]
net=[]
for l in string.uppercase:
    d=l+":/"
    if os.path.isdir(d):
        if os.path.islink(d): #ismount doesn't work either
            net.append(d)
        else:
            lok.append(d)

print "local drives", lok
print "network drives",net
------------------------------------------------

Could anybody help please?

Tanks
Marcus



More information about the Python-list mailing list