Ricardo Jorge wrote:
Just try using the regular python os.listdir()

Use this code:

.....

        ctr = srvsvc.NetShareInfoCtr()
        shares = conn.NetShareEnumAll(u'localhost', ctr, 0, 0)

        print "\n\n============"
        print "There are " + str(shares[0].ctr.count) + " shares"
        print "============\n"

        for i in range(0, shares[0].ctr.count):
                share_info = info = conn.NetShareGetInfo(u'localhost',
shares[0].ctr.array[i].name, 2)
                print share_info.name + "\t" + share_info.path + "\t "
+ share_info.comment

                if len(share_info.path) > 0:
                        try:
                                print os.listdir(share_info.path)
                        except:
                                pass

        print "\n\n"

.....

Just note that share_info.path is returning the path name "windows
style" (c:\blabla) so the dir listing will (most likely) fail. You'll
have to convert this if required.
I would like to list remote samba shares contents (most of which are windows machines), not the local ones. So os.listdir() cannot help here.
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba

Reply via email to