How to read a Bunch of files in a directory in lua -
i have path (as string) directory. in directory, bunch of text files. want go directory open it, , go each text file , read data.
i've tried
f = io.open(path) f:read("*a")
i error "nil directory"
i've tried:
f = io.popen(path)
i error: "permission denied"
is me, seems lot harder should basic file io in lua?
a directory isn't file. can't open it.
and yes, lua has (intentionally) limited functionality.
you can use luafilesystem or luaposix , similar modules more features in area.
Comments
Post a Comment