Skip to content

Instantly share code, notes, and snippets.

@mskorzhinskiy
Last active October 24, 2015 16:13
Show Gist options
  • Save mskorzhinskiy/19b07acbfd5dcd14e0d3 to your computer and use it in GitHub Desktop.
Save mskorzhinskiy/19b07acbfd5dcd14e0d3 to your computer and use it in GitHub Desktop.
Table serialization to file for Alan
function table_save(table, filename)
local file = fs.open("w", filename)
local data = textutils.serialize(table)
file.write(data)
file.close()
end
function table_load(filename)
local file = fs.open("r", filename)
local data = file.readAll()
local table = textutils.unserialize(data)
file.close()
return table
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment