Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function loadTableFromFile(path)
- local file = fs.open(path, "r")
- local table = textutils.unserialize(file.readAll())
- file.close()
- return table
- end
- function saveTableAsFile(path, table)
- local file = fs.open(path, "w")
- local data = textutils.serialize(table)
- file.write(data)
- file.close()
- end
- return {
- loadTableFromFile = loadTableFromFile,
- saveTableAsFile = saveTableAsFile
- }
Advertisement
Add Comment
Please, Sign In to add comment