os.walk equivalent for smb shares
#1
Question 
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?
Reply
#2
bolt Wrote: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.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
VDRfan Wrote: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.
Reply
#4
Ok, a proper file naming is needed to use the library. Sorry for the thread-napping.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#5
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.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#6
you could try using the python libs smb.py and nmb.py - these provide all sorts of smb functions.
Retired from Add-on dev
Reply
#7
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.
Reply

Logout Mark Read Team Forum Stats Members Help
os.walk equivalent for smb shares1