Saving Data in Standalones

Peter Haworth pete at mollysrevenge.com
Mon Jun 7 12:01:59 EDT 2010


Thanks for all the suggestions folks.

I've already set up a preferences file and rewritten the code that  
opens my db to get it's path from there and store the path there if a  
different db is opened and all works well.  Thanks to Sarah Reicheldt  
for the function that returns the user's Preferences folder on OSX or  
Windows.  I have a bunch of other preferences that I'm currently  
storing in custom properties and plan to convert the handling of them  
to use the preferences file also.

As an aside, I did come across a couple of other gotchas in the course  
of implementing that.  I read that opening a file for write access  
will create it if it doesn't already exist.  Perfect I thought, then  
was mystified that it wasn't happening until I scrolled down the  
dictionary entry and found a user comment that files are NOT created  
if their enclosing folder does not exist.

Mark, thanks for the idea of passwording my stack to avoid the  
possible unauthorised modification of it.  I'm thinking I'm probably  
being somewhat paranoid on that front but it could happen.  I also  
like your idea of keeping the substacks in separate files right from  
the development stage for the reason you mention - that it avoids the  
standalone being run/tested in a different environment than in  
development.

Kay, thanks for the suggestion of saving things in my sqlite  
database.  I had indeed thought of that and I may still go ahead with  
that approach.  The main reason I haven't just jumped in and done it  
already is the one you referred to which is the considerable amount of  
coding changes I'd need to make.  Plus the db designer in me is  
baulking at the idea of storing real application data and internal  
data in the same db but I guess I could overcome that or even use a  
separate db.

The only thing I'm still unsure of is this whole issue of the  
Applications folder not being enabled for write access.  On my Mac  
(OSX 10.5), i have read and write access to the Applications folder  
but this keeps coming up which makes me wonder if my Mac is not  
configured in the standard way.  I don;t recall ever changing the  
permissions on the Applications folder, but it is possible.  Don't  
want to assume my Applications folder is set up normally and then find  
that everything falls down when other people try to run the app.

Pete Haworth






More information about the use-livecode mailing list