标签:io ar for 文件 div on art cti html
require"lfs" function findindir (path, wefind, r_table, intofolder) for file in lfs.dir(path) do if file ~= "." and file ~= ".." then local f = path..'\\'..file --print ("/t "..f) if string.find(f, wefind) ~= nil then --print("/t "..f) table.insert(r_table, f) end local attr = lfs.attributes (f) assert (type(attr) == "table") if attr.mode == "directory" and intofolder then findindir (f, wefind, r_table, intofolder) else --for name, value in pairs(attr) do -- print (name, value) --end end end end end local currentFolder = [[C:\]] ------------------------------------- local input_table = {} findindir(currentFolder, "%.txt", input_table, false)--查找txt文件 i=1 while input_table[i]~=nil do print(input_table[i]) i=i+1 end
标签:io ar for 文件 div on art cti html
原文地址:http://www.cnblogs.com/gcczhongduan/p/4035176.html