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

Popular posts from this blog

xslt - Substring before throwing error -

Google Cloud Bigtable Durability/Availability Guarantees -

Android M doze mode and "native" posix socket freezing up -