如何使用Lua检查文件是否存在?
Try
function file_exists(name) local f=io.open(name,"r") if f~=nil then io.close(f) return true else return false end end
但请注意,此代码仅测试文件是否可以打开进行读取。