0


Is there any command to get all file names in folder as table? For example, folder cs2d/lua/example - files in it: 1.cfg,2.cfg; And command must return {"1.cfg","2.cfg"}

flag offensive
asked 2010-05-17 18:33:21.148139
1
add comment
2 Answers:
0


Look at the tut about binary modules I posted.
There I teach how to make that (using it as an example)

permanent link | flag offensive
answered 2010-05-17 18:36:47.295121
21
add comment
0


As of now, the best way of doing this is to implement it as an extension (via Flacko's suggestion). There are some precooked code out there if you need them. The alternative is to use the system call to get the list of files (typically ls or dir) The problem with this is that Lua requires a separate interface for system calls, and it'll actually open up a standalone terminal rather than buffering the io to a temporary file, therefore it's not ideal.

Prewritten extensions: http://keplerproject.github.com/luafilesystem/

permanent link | flag offensive
answered 2010-05-17 20:06:41.292278
41
add comment
Your answer:
You are now not logged in but you can answer first and then login
toggle preview



Tags:

× 2
× 1

Asked: 2 years ago

Seen: 1,069 times

Last updated: 2 years ago

Made with Django.