best place to save persistant script data? - LUA Scripting - CHDK Forum

best place to save persistant script data?

  • 4 Replies
  • 3262 Views
best place to save persistant script data?
« on: 30 / January / 2009, 02:06:48 »
Advertisements
is there a recommended location for persistent script data? i'm saving some vars between script execution.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: best place to save persistant script data?
« Reply #1 on: 30 / January / 2009, 09:38:59 »
I'd use A/CHDK/DATA.
AFAIK it currently only holds the bootup logo, which is static but I think the directory name is suitable for (more or less temporary) script data as well...

It may not exist, so it should be checked and created with os.mkdir if it isn't there...

*

Offline reyalp

  • ******
  • 13746
Re: best place to save persistant script data?
« Reply #2 on: 30 / January / 2009, 14:51:24 »
fudgey: it also holds the saved script options. As long as your names don't collide with those, it should be OK.

Don't forget what the H stands for.

Re: best place to save persistant script data?
« Reply #3 on: 31 / January / 2009, 20:55:04 »
who else is using it to save script options? just curious what method they're using. i'm using this script - http://lua-users.org/wiki/SaveTableToFile

and i'm quite happy with it so far.


*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: best place to save persistant script data?
« Reply #4 on: 01 / February / 2009, 03:29:31 »
who else is using it to save script options?

You're probably the first. What reyalp said and I forgot is that CHDK itself uses it to store script parameters for each script nowadays (before that was added, CHDK only remembered user changes to params of currently loaded script and stored it in CHDK config file, now there's param sets and the ability to reset to default parameters in script menu and stores them in A/CHDK/DATA/).

 

Related Topics