Solved - Why does xbmcvfs.listdir() list files inside archive files?
#1
When using xbmcvfs.listdir(path) the returned file list is not true if the path contains a file named .rar, then the file name inside the archive is listed. This cannot be correct?!
Imagine doing:

Code:
for file, folder in xbmcvfs.listdir(somepath):
  if ".avi" in file:
    play(os.path.join(somepath, file)
this will fail if the avi is inside a .rar since then the path should be rar://......

Trac ticket http://trac.xbmc.org/ticket/13551
Pneumatic | SABnzbd | XBMC that just works - openelec
Reply
#2
You should not assume that the file names returned by xbmcvfs.listdir may be appended to the path. The filesystem need not be hierarchical.

I believe there is a version of xbmcvfs.listdir that returns listitems - use that instead.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
(2012-11-15, 02:52)jmarshall Wrote: You should not assume that the file names returned by xbmcvfs.listdir may be appended to the path. The filesystem need not be hierarchical.

I believe there is a version of xbmcvfs.listdir that returns listitems - use that instead.

Ok, the example is maybe not 100% correct. Still, my expectation of the methods available through xbmcvfs is that they should be as close to the ordinary python equivalents but with the ability to handle the xbmc specific path options... os.path.listdir doesnt do any file inspection magic.
Pneumatic | SABnzbd | XBMC that just works - openelec
Reply
#4
Ticket Closed, thank you!
Pneumatic | SABnzbd | XBMC that just works - openelec
Reply

Logout Mark Read Team Forum Stats Members Help
Solved - Why does xbmcvfs.listdir() list files inside archive files?0