lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


save.lua in the test directory of the lua distribution does exactly what you
are looking for.
(i guess you only need global variables saved, not the entire state
including stack etc.)

Regards,

Peter

-----Original Message-----
From: owner-lua-l@tecgraf.puc-rio.br
[mailto:owner-lua-l@tecgraf.puc-rio.br]On Behalf Of Brian Hook
Sent: Thursday, October 04, 2001 9:03 PM
To: Multiple recipients of list
Subject: Archiving lua_state to disk/memory


Is there a simple way to archive an existing lua_state to disk (the
opposite of lua_dobuffer, e.g. a lua_writebuffer type of thing), or
should I just handle it myself by iterating over all the tables and
writing out the values?

I have some configuration files that are loaded and potentially
modified, and I'd like to write them out.  I don't mind parsing and
writing it out myself, but if something like this already exists, I'd
like to avoid the extra work.

Thanks,

Brian