package filesystem

Started by
3 comments, last by Alberth 3 months, 2 weeks ago

I am writing a filesystem for my game. I want to read and write data to ram, while seeking the package to sync data to the hard drive. How would I go about this, and where should I start.

Advertisement

you can read orge3d code.it has a vfs

Probably start by better defining what you need.

Any/every file system can load data into memory. That is simply loading.

“seeking the package to sync data to the hard drive” doesn't really explain what you are doing. What you are storing and how are you organizing it can matter tremendously. There are many organization patterns, and the size, layout, access patterns, and easiest interfaces will all be dependent on what you are actually doing.

If you prefer to write code rather than deciding what you need to have, I'd suggest to start with a TAR file. Programs exist that can read and write such files.

The file format is very easy as well, a header and a sequence of files basically. Writing a program that can list the files stored in a tar file is a good first step.

As for performance: The format was designed to store many files at a tape, so it's designed for sequential access. Depending on you file access pattern (do you always read all files in the same order, or do you randomly access different files, or …) you may want to think about an alternative format.

This topic is closed to new replies.

Advertisement