On Wed, Nov 24, 2010 at 6:01 PM, Richard Hipp <[email protected]> wrote:

> On Wed, Nov 24, 2010 at 6:15 AM, Max Vlasov <[email protected]> wrote:
>
> > Hi,
> >
> > I'm trying to implement read-only access to sqlite database saved in the
> > Windows RC_DATA resouce (of the same exe file). There are different
> > additional files involved when the db is writable (-journal for example),
> > but it looks like one can have no special knowledge about them since
> there
> > is a flag in xOpen allowing to detect the main db. But notable exception
> is
> > xAccess. I can not see from the parameters whether this checking is about
> > main db or journal file. If I return ok for SQLITE_ACCESS_EXISTS, sqlite
> > goes wrong way with assuming the journal exists (at least different calls
> > lead to "unable to open" error). But also the debugging shows that
> xAccess
> > never checks for the main file existence, only supplemental ones. Can I
> > rely
> > on that and return FALSE unconditionally? Currently it works, but it
> might
> > give a new failure in the future.
> >
>
> We have no plans to change the current behavior.  But who knows what issue
> might come up in the future in which we'll need to call xAccess on the main
> database file.  You would do well to check the filename before returning
> your answer, I think.
>
>
Thanks, Richard, I thought about the name's checking, but being a little
paranoid wondered whether the current implementation of sqlite allows for
main db being named with -journal postfix or it's forbidden? If the latter,
I indeed can assume that if the name ends with  -journal (maybe also other
postfixes related to WAL), it is a special request. If former, I easily can
forbid those postfixes for main db in my xOpen implementation resolving any
paranoid variant.

Max
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to