Add files via upload

This commit is contained in:
CoCo ainrm-
2022-02-11 17:06:16 +08:00
committed by GitHub
commit f5f44f2e03
14 changed files with 558 additions and 0 deletions

21
fileio.lua Normal file
View File

@@ -0,0 +1,21 @@
function readfile(path)
local file = io.open(path, "r")
if file then
local content = file:read("*a")
io.close(file)
return content
end
return nil
end
function writefile(path, content, mode)
mode = mode or "w+b"
local file = io.open(path, mode)
if file then
if file:write(content) == nil then return false end
io.close(file)
return true
else
return false
end
end