I would like to implement a very simple Virtual Filesystem (VFS) which supports some basic file system operation like fwrite, fopen, fput, etc. The VFS is an abstraction lay
Actually implemented this, so from experience here:
The first thing to do is use classes. There is no fopen()
equivalent. If there are flags, they're going to be an enum. Filenames are wchar_t nowadays.
The second thing to do is factor out the OS-dependent parts of your file class. They should be in separate methods. You move these to a seperate file. For every OS you have, there will be a different file implementing the same methods. When you link your app, you know the target architecture and you can pick the correct versions.