Here's how I do it, there are multiple drivers that implement FS_FileSystem structs and call attach_filesystem to add them to the list.
http://brainbox.cc/repository/trunk/six ... lesystem.c
you can also see the related header file:
http://brainbox.cc/repository/trunk/six ... lesystem.h
Questions about file handling
Re: Questions about file handling
But what if I do readdir on "/". Then it wont list foo as a dir.bluemoon wrote:Don't mix volumes with mount table, they can be isolated.
Think about this, you have a list of volume objects, which can do this thing:
FILE_NODE file;
volume->open(&file, "/abc.txt");
Now, the mount mechanism is merely hash mapping.When open a fileCode: Select all
vfs_mount_add("/", vol[0]); vfs_mount_add("/foo/", vol[1]);
This resolve into vol[1] and pass "/abc.txt" to it.Code: Select all
vfs_open(/foo/abc.txt");
My GitHub account: http://github.com/tobbebia
Re: Questions about file handling
One way to workaround that is to enforce a directory present before mounting. Just like any unix.
ps. I see nothing wrong by not showing /foo if it does not exist on the volume. It's just a metter of policy and user experience.
ps. I see nothing wrong by not showing /foo if it does not exist on the volume. It's just a metter of policy and user experience.
Re: Questions about file handling
Thanks for your informing replies! As I'm not a very experienced linux user I didn't know about that. So basically I should make an initrd filesystem and create those folder: "/dev, /dev/hdd0, /dev/usb" etc?bluemoon wrote:One way to workaround that is to enforce a directory present before mounting. Just like any unix.
ps. I see nothing wrong by not showing /foo if it does not exist on the volume. It's just a metter of policy and user experience.
My GitHub account: http://github.com/tobbebia