--写入
local file = assert(io.open("demo.txt",'w'))--'a'追加
file:write("写入内容") --file:flush()
file:close()
--读取
local file = assert(io.open("demo.txt",'r'))
local content = file:read("*all")
print(content)
file:close()
--输入输出
str = io.read()
num = io.read("*number")
print(str..num)
Lua IO
最新推荐文章于 2024-08-12 17:35:41 发布