2004-10-05, 00:07
hi,
i was trying to get a list of files on a samba share.. i can happily get a list of files doing this:
but if instead i change "q:\" to a samba share, such as smb://192.168.0.1/share/directory/
it is unable to browse the directory...
i can understand that os.walk wouldn't understand about smb shares, but i was wondering if there was a way i could get such a listing. i was hoping for some api exposed from the xbmc object.
the purpose of this is so i can get a listing of files, and then randomly pick one to play.. the script will later become more complex.... if i hardcode the path to a file i want to open, such as smb://192.168.0.1/share/directory/movie.avi it will play it fine, but trying to get a directory listing is my problem atm.
thanks for any help
andrew
i was trying to get a list of files on a samba share.. i can happily get a list of files doing this:
Quote:for root, dirs, files in os.walk("q:\"):
[self.list.additem(join(root, name)) for name in files]
but if instead i change "q:\" to a samba share, such as smb://192.168.0.1/share/directory/
it is unable to browse the directory...
i can understand that os.walk wouldn't understand about smb shares, but i was wondering if there was a way i could get such a listing. i was hoping for some api exposed from the xbmc object.
the purpose of this is so i can get a listing of files, and then randomly pick one to play.. the script will later become more complex.... if i hardcode the path to a file i want to open, such as smb://192.168.0.1/share/directory/movie.avi it will play it fine, but trying to get a directory listing is my problem atm.
thanks for any help
andrew