On Mon, Jan 11, 2016 at 7:57 PM, Stephan Beal <sgbeal at googlemail.com> wrote:

> On Mon, Jan 11, 2016 at 7:55 PM, Warren Young <wyml at etr-usa.com> wrote:
>
>> On POSIX systems, you can securely create a temp file that only your user
>> can see via the mkstemp(3) C library call.  SQLite will happily open the
>> resulting 0-byte file, allowing you to create your schema inside it.  Then
>> when the file is set up, you can move it into the desired location and
>> change its file modes so that the other processes can open it.
>>
>> There must be an equivalent of mkstemp() on Windows, doubtless taking 3
>> times as many parameters and with a function name 4 times as long. :)
>>
>
> sqlite exposes the functionality of fetching a temp file name using its
> mechanism, but i don't recall at the moment how it's done. A quick google
> isn't revealing it but i recall using it but finding out that it doesn't
> work with the :memory: VFS.
>

https://www.sqlite.org/c3ref/file_control.html
http://sqlite-users.sqlite.narkive.com/oehps0E9/proper-use-of-sqlite3-file-control

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

Reply via email to