Jump to content
  • Advertisement
Sign in to follow this  
guyaton

virtual file system directory

This topic is 4837 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Looking at making a virtual file system and was wondering what was the best way to load the directories into memory? vectors, list, hash table? Program currently uses a header that contains the file name and the offset in the file as well as the size. Any suggestions? ~guyaton

Share this post


Link to post
Share on other sites
Advertisement
Well it depends on what functionality your virtual directories support and what the container you want to use is actually storing.

Share this post


Link to post
Share on other sites
Pretty much i just want to load a list of the files, file that they're encapsulated in, their offset in that file and their size. From there I am just going to want to load it and do whatever I need to do with it.

~guyaton

Share this post


Link to post
Share on other sites
If it's a fairly small, flat structure (ie. just to collect a few files together) a vector would probably do. However, if you are talking about a virtual hard disk kind of thing where you're going to have loads of files and a more complex structure, you probably want to look at a tree structure like a B* tree.

It's worth reading up on existing file system architectures and top-end database structures to get some ideas.

Another option is to look at virtual disk drivers. There is one here: http://chitchat.at.infoseek.co.jp/vmware/vdk.html

Share this post


Link to post
Share on other sites
naw...wasn't thinking anything that complicated, at most one directory from the home directory. I was just wondering the best way to store it. Maybe an example will help. For ease of reading i'll put it in some XML (tho it won't be in the file).

<directory filedir="Textures">
<file filename="tx1.bmp" size=15023 offset=234 \>
<file filename="tx2.bmp" size=243245 offset=7864 \>
</directory>
<directory filedir="Models">
<file filename="model1.x" size=5432 offset=5433 \>
<file filename="model2.x" size=4654 offset=97223 \>
</directory>

something that simple to load.

edit: might want to go one level deeper. not sure yet.

Share this post


Link to post
Share on other sites
Yes, its a good idea to start with the tree, and not necessarily B. You can have an AVL or an N tree for your file system. For an example of such package file, see my
tutorial

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!