Quoting from the manual:
table.load( file, table ) restores a Lua table from a data file that has been saved with table.save()
table.save( file, table )saves the given table into the given file
I don't get this to work. Any help would be appreciated!
table.save
Re: table.save
I have forgotten to reenable the table-save/restore functions after disabling them for testing purposes.
Sorry, I'll fix it on sunday. Until then, just copy the functions from LuaGlobal.lua and put them in a script. Changes in LuaGlobal.lua itself will have no effect as the original is restored on startup.
Sorry, I'll fix it on sunday. Until then, just copy the functions from LuaGlobal.lua and put them in a script. Changes in LuaGlobal.lua itself will have no effect as the original is restored on startup.
-
- Posts: 13
- Joined: Fri May 15, 2009 12:52 pm
Re: table.save
How do I get the user's home directory?
Re: table.save
We don't offer a function for this yet, unfortunately. But needing to know the home dir sounds awfully fishy!
If you want to store settings, this function should return the dir you should stuff them in for linux / windows:
Needs filling in for OS X though.
If you want to store settings, this function should return the dir you should stuff them in for linux / windows:
Code: Select all
function get_settings_dir()
if os.getenv("WINDIR") ~= nil then -- Unix
if os.getenv("XDG_CONFIG_HOME") == nil then
return os.getenv("HOME") .. "/.config"
else
return os.getenv("XDG_CONFIG_HOME")
end
else -- Windows
return os.getenv("APPDATA")
end
end