lua遍历文件夹
来源:互联网 发布:java面试葵花宝典 编辑:程序博客网 时间:2024/06/10 06:19
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 endendlocal currentFolder = [[C:\]]-------------------------------------local input_table = {}findindir(currentFolder, "%.txt", input_table, false)--查找txt文件i=1while input_table[i]~=nil doprint(input_table[i])i=i+1end
1 0
- lua遍历文件夹
- lua遍历文件夹
- lua遍历文件夹, zerobrane下载
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 文件夹遍历
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 遍历文件夹
- 文件夹遍历
- 遍历文件夹
- 寻找富婆- 爱在这儿,联系QQ846460508
- 最新免费宽带wifi破解办法,接洽QQ846460508
- 删除卷与分页文件(虚拟内存文件)
- Leetcode--Single Number II
- Ibatis,Spring注解方式注入sqlMapClient
- lua遍历文件夹
- shell expect spawn、linux expect 用法小记 看着舒服点
- 修剪草坪
- HTTP协议详解
- UVA 11464 Even Parity(枚举递推)
- Hashtable 和Hashmap 的区别——该死的中兴通讯在2014年签约时临门问这个问题还让写迭代器
- 程序猿的快速学习法——以JS学习为例,进行图解
- 原型模式C++实现
- Pan's Labyrinth (找组成的三角形最大的高)