panda3d.org/apiref.php?page=Mult … nDirectory
is not exposed to python. I think that is due to it asking for a list of strings. Could we expose functions like this in the future?
Multifile.scanDirectory() isn’t published, but vfs.scanDirectory() is. (It returns a special object that Python can traverse).
If you just want to scan a multifile that hasn’t been mounted, walk through the list of subfiles with Multifile.getNumSubfiles()/Multifile.getSubfileName(n) (or, in 1.6, use Multifile.getSubfileNames()).
Also note that in 1.6 you have direct.stdpy, which provides both listdir() and walk(), reimplementations of the standard os module functions, but vfs-aware.
David
i used:
def scanDirectory(mf,path):
for idx in range(mf.getNumSubfiles()):
name = mf.getSubfileName(idx)
if name[0:len(path)] == path:
yield name
having reimplementation of standard python function be vfs aware is even better!