欢迎您!
我关闭了一个类似的话题,但我遇到了一个问题。
我有这样的剧本。
该脚本从/lua/xxx.lua读取任何文件。
问题是我想阅读旧的test.lua,但是当我上传一个新的test.lua时它会被删除。
我可以用Air202阅读旧的test.lua吗?
感谢您提供的信息。
Can I restore (read) the old test.lua user script sent to Air202?
Hello!
I closed a similar topic, but I encountered a problem.
I have such a script.
The script reads any file from /lua/xxx.lua.
The problem is that I want to read the old test.lua, but it is deleted when I upload a new test.lua.
Can I read the old test.lua with Air202?
Thank you for the information.
module(...,package.seeall)
local function print(...)
_G.print("test",...)
end
f = "/lua/test.lua"
local function readFile()
print(readtxt(f))
end
sys.timer_start(readFile,30000)
function readtxt(f)
local file,rt = io.open(f,"r")
if not file then print("sys.readtxt no open",f) return "" end
rt = file:read("*a")
file:close()
return rt
end