Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1057259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:50:22+00:00 2026-05-16T17:50:22+00:00

I am about to implement a custom VFS (virtual file system) for a Netburner

  • 0

I am about to implement a custom VFS (virtual file system) for a Netburner embedded device (non windows) using FOpen, FRead, FWrite, FSeek, and FClose. I was surprised that i could not find a FOpen* version of the VFS available. It would make it a lot more portable to embedded devices.

I found some information on creating the VFS for SQLite here
http://sqlite.org/c3ref/vfs.html
but the information is very detailed and I have lots of other questions about the implementation.

I have some example VFS in the SQLite source code for Win, OS2, Linux but they don’t have a lot of comments, only source code.

I could use the information provided in the link above and the examples to create my custom VFS but i’m sure that I would miss something if I did it that way.

My questions are:

  • Is there any more documentation about the SQLite VFS that I am missing? Maybe an implementation guide?
  • Is there an Fopen version of the SQLite VFS that is available?
  • Is there a unit testing code available to test my custom SQLite VFS once I have created it?
  • Suggestions, comments, experiences with implementing SQLite VFS that you would like to share.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:50:23+00:00Added an answer on May 16, 2026 at 5:50 pm

    Did you notice that there is an additional source of documentation in the header file sqlite3.h? Also, Google code search is your friend.

    Don’t worry too much about missing things, this is what the test suite is for. Take a guess at the purpose of every method from their name, the documentation and the example implementations; go for a first-draft implementation; run the tests on your target platform; iterate until the bar is green. From a cursory reading of the interface doc that you quoted, here are some educated guesses:

      int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
                   int flags, int *pOutFlags);
      int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
      int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
      int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
    

    Those are your run-off-the-mill file management functions. You’ll notice that xOpen() in turn returns a structure sqlite3_file, that has pointer methods of its own for reading and writing.

      void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
      void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
      void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
      void (*xDlClose)(sqlite3_vfs*, void*);
    

    Those are for shared libraries (see the dlopen() man page on Linux). In an embedded environment, you probably can leave these unimplemented (try setting these to NULL).

      int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
    

    You might have to implement a random number generator, if your OS’ standard library doesn’t provide one already. I suggest a linear feedback register, which is small yet good.

      int (*xSleep)(sqlite3_vfs*, int microseconds);
      int (*xCurrentTime)(sqlite3_vfs*, double*);
      int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
    

    These are the time management functions, to hook up with your OS.

      int (*xGetLastError)(sqlite3_vfs*, int, char *);
    

    You can get away by always returning 0 here 🙂 See unixGetLastError in os_unix.c (thanks Google Code Search!)

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm about to implement a feature in our application that allows the user to
I'm about to implement a logging class in C++ and am trying to decide
I've been thinking about how to implement the badge feature similar to SO's on
I was reading the MSDN article about how to implement IDisposable and I am
So this post talked about how to actually implement url rewriting in an ASP.NET
I wondered about the best way to implement a correct, flexible and fast Equals
I asked here about a protocol that I was asked to implement, and how
Are there any free tools that implement evidence-based scheduling like Joel talks about ?
As I learn more and more about OOP, and start to implement various design
Recently I've been thinking about finite state machines (FSMs), and how I would implement

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.