Re: Persistent data with starkits and starpacks

Jean-Claude Wippler <[email protected]> Mon, 23 Feb 2009 11:26:44 +0100
Newsgroups gmane.comp.lang.tcl.starkit
Message-ID <[email protected]>
On 23 Feb 2009, at 05:16, irrational wrote:

> I conclude then that if I want persistent data across sessions I have
> to either (1) distribution as a starkit, or (2) write the persistent
> data out to a file somewhere in OS file system.

It's an OS-enforced no-no: you can't write to running executables.

If you insist on doing something to that effect anyway, you'll need to  
launch something else, make the changes, and re-launch the modified  
starpack. I.e. save to another file and switch/rename from a batch  
file / shell script, for example.

> The problem with (1) is my users are not savvy and need a simple
> clickable application. Preferably with a sweet little icon.
>
> The problem with (2) is where to put the data? Every OS has different
> conventions, user areas and privileges, etc. Any suggestions on this,
> surely others have deal with this before?

One approach I've used a few times is to create a starkit next to the  
app at runtime.

FWIW, I recently used a minimal starpack with just enough startup  
logic to fetch the real app as a starkit and then launch it - that  
allows me to use the same mechanism for on-line updates: check for a  
new version and adjust local copy accordingly if needed, then launch  
it. With a starsync-like approach, that can be done without disrupting  
other data saved locally in that same file - config params, caches,  
whatever.

-jcw