PDA

View Full Version : os.walk equivalent for smb shares


bolt
2008-10-16, 00:28
I have access to several smb shares on my local network owned by different people and I'm trying to build a plugin to show recently added files on those shares(trying to update the library is way too slow). I have the code working for local directories but I need to build a version of os.walk that will work on smb shares. It seems that httpapi's GetDirectory function will work but I'm hoping there is a better way to list files on smb shares. Is there?

vdrfan
2008-10-16, 00:34
I have access to several smb shares on my local network owned by different people and I'm trying to build a plugin to show recently added files on those shares(trying to update the library is way too slow). I have the code working for local directories but I need to build a version of os.walk that will work on smb shares. It seems that httpapi's GetDirectory function will work but I'm hoping there is a better way to list files on smb shares. Is there?

Sorry don't know but maybe a python guy could tell you more about, but i was wondering why the library update is too slow for you. Once scanned it will find changes within seconds here .. even on bigger networks.

bolt
2008-10-16, 00:54
Sorry don't know but maybe a python guy could tell you more about, but i was wondering why the library update is too slow for you. Once scanned it will find changes within seconds here .. even on bigger networks.

I'm not sure why it's slow. It might have something to do with the haphazard way I add shows to the library. It's also on the xbox, which is slow. But the bigger issue is that there is no guarantee that new files will actually be added to the library since they aren't necessarily named properly. I also tend not to use the library because of this.

vdrfan
2008-10-16, 00:57
Ok, a proper file naming is needed to use the library. Sorry for the thread-napping.

Nuka1195
2008-10-16, 02:57
os.walk should work for linux and osx. not sure if virtual directory for python has been merged for xbox or windows. i think it is suppose to be, not sure when.

BigBellyBilly
2008-10-17, 10:51
you could try using the python libs smb.py and nmb.py - these provide all sorts of smb functions.

bolt
2008-10-20, 07:40
I ended up tossing the script onto my media server and running a cronjob to output the results as a webpage, which should be more useful to the other people on my network. A simple webscraper plugin lets me use it from my xbox.