On 7 Nov 2013, at 5:42pm, L. Wood <lwoo...@live.com> wrote: > How would you adapt SQLite to this environment? > > Here are my own thoughts so far (based on the webpage > http://sqlite.org/tempfiles.html): > > * I'm aware of the files that SQLite can write to the *same* directory as > that of the actual database file, and I have ways to deal with that (by > putting the database file into a so-called package, so all the files will be > together as a unit).
Sandboxed apps cannot change their own bundles. This is to stop an app from downloading new code and rewriting itself, turning itself into malware. You should use the app's container directory as described here: <https://developer.apple.com/library/mac/documentation/security/conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html> Be careful about how you're using "cStringUsingEncoding:" or "UTF8String" and it'll all work fine. > * If I set the global variable sqlite3_temp_directory > (http://sqlite.org/c3ref/temp_directory.html) to the value returned by > Apple's NSTemporaryDirectory(), I'm hoping to be fine. Will I? You should find that the default temp directory should already be set to a place that's compatible with app sandboxing. I don't remember whether it actually was NSTemporaryDirectory() but it was somewhere that's safe and worked. Or at least it was when I tested. Of course, this may have been changed in later releases of OS X, so if you find you do get errors please tell us. On the other hand, if you feel happier explicitly setting it to NSTemporaryDirectory then that should work too. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users