On Apr 8, 2008, at 2:16 AM, Ken wrote:

> Dan,
>
> Doesn't that just return the VFS part ??? I'm looking for the
> sqlite3_io_methods part for the default vfs  ( or is this really  
> the sqlite3_file )?

Right. Sorry, I didn't read carefully. :)

I don't really see why you will need it unless you do intend
to open the underlying journal file. The sqlite3_io_methods
structure contains methods you can invoke on a file only after
it has been opened (i.e. xRead(), xWrite()).

When your vfs opens "real" files, you need to call:

   pDefaultVfs->xOpen(pDefaultVfs, zFile, pOut, flags, &outflags);

Where pOut is a pointer of type sqlite3_file* that points to
at least pDefaultVfs->szOsFile bytes of free space. The default
vfs implementation will populate pOut->methods with a pointer
to the sqlite3_io_methods structure that contains the methods
for the default "real" file implementation.

Dan.



>
> Thanks,
> Ken
>
>
> Dan <[EMAIL PROTECTED]> wrote:
> On Apr 8, 2008, at 2:03 AM, Ken wrote:
>
>> Hi all,
>>
>> I'm trying to implement a vfs that will disable journalling.
>>
>> But i've hit a little stumbling block / learning curve.
>>
>> In the vfs implementation I need to implement a sqlite3_io_methods
>> type. Basically I'd like to get the default  sqlite3_io_methods and
>> use those as part of my code as follows:
>>
>> // IO_METHOD_OPEN
>>   njOpen(..) {
>>      if  (JOURNAL)  return ;
>>
>>     default_IO_Open(...) ;
>>  }
>>
>>  // VFS call
>>   nonJournalOpen ( ... ) {
>>        static  sqlite3_io_methods njMethods   = {
>>                           1,
>>                     njOpen, ... } ;
>>
>>   }
>>
>>
>> How do I get the address of  sqlites default I/O methods?
>
>    sqlite3_vfs *pDefaultVfs = sqlite_vfs_find(0);
>
> Dan.
>
>
>
>>
>> Thanks for any suggestions.
>>
>>
>>
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to