This repository has been archived on 2024-04-19. You can view files and clone it, but cannot push or open issues or pull requests.
FREAX/etc/lib/config
2022-07-18 19:33:40 +02:00

22 lines
419 B
Text

function load(path)
if fs.exists(path) and not fs.isDir(path) then
local lf = fs.open(path, "r")
local contents = lf.readAll()
lf.close()
return textutils.unserialize(contents)
else
return nil
end
end
function save(cTable, path)
if fs.exists(path) then
if fs.isDir(path) then
return false
end
end
local sf = fs.open(path, "w")
sf.write(textutils.serialize(cTable))
sf.close()
return true
end