On 12/1/06, Dixon Hutchinson <[EMAIL PROTECTED]> wrote:

Just to be safe, I tried specifying FILE_SHARE_WRITE, that did not help.
FILE_SHARE_WRITE would allow other "writers" to open the file shared,
but should not have any effect on whether this open succeeds.

Sharing semantics are bidirectional and affect all opens.

In order for two processes to have a particular file open at the same
time, they must both agree to share the file for the relevent access
rights.  If another process has a file open for write access, then you
try to open it for read access but do not agree to allow other
processes to write to it at the same time, then your open cannot
succeed.  Otherwise the other process could write to the file when you
are not prepared for it, causing you to read inconsistent data.

If I ignore the failure and try to open the DB with sqlite3_open, the
open succeeds just fine.  All I want to do really is test for the
existence of the file and whether or not I have permissions to open it
with sqlite.

sqlite's open calls are in os_win.c.  The standard
sqlite3WinOpenReadWrite() requests GENERIC_READ and GENERIC_WRITE
access, with FILE_SHARE_READ|FILE_SHARE_WRITE sharing.

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to