Virtual File System with C / C ++ for Windows

I am currently developing a game simulating an operating system. So I need a file system. I am currently using zziplib to be able to download files from a zip archive, however this is a read-only file system and I need a way to write new files and then serialize them (and deserialize them during the next run)! Are there any useful libraries in the wild that need to be used, or should I write one for myself based on any of them?

+6
source share
3 answers

This is probably one of the places where using a simple database as a file system makes sense.

Use something like sqlite to store data (with paths in the form of keys, drops in the form of data, or something like that).

One of the advantages of this is that you don’t really have to worry about the repository, and you can use existing database tools to view / edit data β€œoffline”, instead of writing it yourself. (In addition, you can also store other information about the game).

+6
source

You can check out PicoStorage and the C ++ embedded file system . I did not use it directly, but I looked at them both. The embedded file system has a dependency, which can be a test plug - it requires Qt to be linked. It might be possible to remove it, but it uses it mainly for QString and QFile (and it will have no reason to require a user interface).

+5
source

My six pence above answers above. SolFS and CodebaseFS provide virtual file system capabilities; both have an API for C / C ++ and seem to do exactly what you are asking for. However ... the scope of your task is not clear to me. Does your game have to manage dozens, hundreds, zones, ... files? What are the sizes of these files? Etc etc. I would raise these questions before looking for a suitable solution.

+2
source

Source: https://habr.com/ru/post/890408/


All Articles