Trevor,
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.

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.

Trevor Talbot wrote:
On 12/1/06, Dixon Hutchinson <[EMAIL PROTECTED]> wrote:
I have multiple processes accessing the resulting DB. One of those
processes only queries the DB.  I call:
  h = CreateFile(path, GENERIC_READ,  FILE_SHARE_READ,
             NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
to verify the file exists before declaring an error if it does not
exists.  The problem is that CreateFile is returning error in this case
and GetLastError() tells me that "The process cannot access the file
because it is being used by another process."  Is there any reason that
the second CreateFile above would be incompatible with whatever SQLite
uses to open the file?

You do not specify FILE_SHARE_WRITE, so if another process has it open
with GENERIC_WRITE (or equivalent) permissions, your call will fail.

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


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

Reply via email to