The data I want to save is game-specific. Actually, no reason not to just tell you my idea: a way to store information about "achievements" in the style of console games or Steam games. Such games remember what you've achieved irrespective of saving, loading, undoing, etc., but the information is game-specific. I'd like to finish an extension for this within a month or so.
Michel Nizette wrote:
Though at the other end of the spectrum, you may want your settings to persist even across abnormal session terminations (such as power outages or interpreter crashes), in which case you'd want to save the persistent state to a file as soon as possible when it changes.
I was just thinking something like that. I like Tomas's idea of storing the data in memory as a transient object, as that saves me from having to read from disk every single time the player types UNDO. But as for writing to disk, I think I'll just do that automatically every time there is a change of state within the set of data my extension is concerned about.