Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function load(path)
- if not fs.exists(path) then return {}, false end
- local f = fs.open(path, "r")
- local t = textutils.unserialize(f.readAll())
- f.close()
- return t or {}, true
- end
- function save(path, data)
- local f = fs.open(path, "w")
- f.write(textutils.serialize(data))
- f.close()
- end
Add Comment
Please, Sign In to add comment