io - Reading Directory for all files of a specified file type -


i want know how following...

i have directory, let's call directory "d:\folder\" , has file types .json, .lua, etc , need able put appropriate files in table based off file type. how do via lua without external libraries? also, how can other information on files, size, date modified, etc via lua , store info?

as yu hao said in comment, lua doesn't have methods list of files in folder or access attributes of files. in terms of external libraries, can use lua filesystem module has need or winapi if looking windows-specific solution. both small libraries can compiled quite using mingw.

if looking windows-only-no-external-library solution, should able run "dir" command , process results using io.popen. can parse captured output , file names, sizes, , dates based on that. can file size using file:seek, since may parsing anyway, can output. don't think there simpler that.

how searching pattern represents , characters file posses , .file_type...and run through io.open example...possible?

you won't able "guess" filenames enumerating possible symbol combinations because .... .... take .... .... .... long .... time.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -