Reading txt files from MF

Hi, is there a easy way to read .txt files in mf and listing files in a dir in mf?

for images, I can directly put the ‘mydir/photo.png’ in onscreenimage after i have decrypt and mount the MF files. However, the ‘with open’ and os.listdir(‘mydir’) won’t work for mf files, is there a way to read files without writing to disc or without initiating multifile and decrypting like the example given?
Thanks.

m = Multifile()
m.openRead("foo.mf")
 
barIdx = m.findSubfile("bar.txt")
if barIdx != -1:
  m.readSubfile(barIdx)

open() and listdir() will work if you do from direct.stdpy.file import open, listdir. That module contains versions of those standard library functions that respect Panda’s VFS.

yes thats it! thanks!