> I suggest this approach:
> 
> 1. Open the database file using sqlite3_open()
> 2. Run sqlite3_exec("BEGIN IMMEDIATE");
> 3. Make a copy of the raw database file using whatever
> high-speed file copy mechanism is at hand.
> 4. sqlite3_close();
> 
> The BEGIN IMMEDIATE operation in step 2 will acquire a read-lock on the
> database file which will insure that no other process modifies the file
> during step 3. But it is also only a read-lock so other processes can
> continue to read the database while you are copying it. Step 4 releases
> the file lock.



This is simpler than what I did, but basically the same conceptually.


---
The Castles of Dereth Calendar: a tour of the art and architecture of 
Asheron's Call
http://www.lulu.com/content/77264

Reply via email to