Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   File System Simulation In C (http://www.go4expert.com/forums/file-simulation-c-t1215/)

rocky1986 16Aug2006 11:19

File System Simulation In C
 
hi

i am working on a project which deals with simulating the unix file system or any other file system .i can invent my own as well.i am developing a unix like shell which will provide all the file handling commands similar to unix.Basically I want to allocate a large file on the actual file system, and treat it as a virtual disk for the file system simulation. In order to implement the file system, I would create and manipulate various data structures on the virtual disk to create and manage the file system. For manipulating the file system's data on the virtual disk, i can use C file functions such as fopen, fread, fwrite etc and implement a unix like shell which will act on this disk.

but my problem is how do i store the tree like unix file system in a file(virtual disk) ??or how do i create data structures like superblock, boot block,inode list, within this virtual disk ??is simulating the unix file system tougher ?if yes then what other options should i look for ?

shabbir 16Aug2006 13:47

Re: File System Simulation In C
 
You need to define the data structure in a better way something like virtual disk has superblock, boot block,inode list and they can be accessed using hashing ...

Unix is a tough one and you can start of with the DOS like system and then move on to the Unix file system simulation.

rocky1986 16Aug2006 13:59

Re: File System Simulation In C
 
but the data structure must be persistant....the only persistant data structure i know of is the file...fore eg. you cant store link list on a hard disk permanently.

and btw i have the option of inventing my own file system...can you give some simple idea ??the only requirement is that the file system should be hierarchial,there should be some options for security and basic file management scheme.

shabbir 16Aug2006 15:08

Re: File System Simulation In C
 
Quote:

Originally Posted by rocky1986
but the data structure must be persistant....the only persistant data structure i know of is the file...fore eg. you cant store link list on a hard disk permanently.

But you can have a file system which can contain other files. Say your virtual system can store some config files which cannot be accesed but just for viewing purpose you have API's
Quote:

Originally Posted by rocky1986
and btw i have the option of inventing my own file system...can you give some simple idea ??the only requirement is that the file system should be hierarchial,there should be some options for security and basic file management scheme.

Simple is start off with having some files into a filesystem file and allow the access based on accesssebility.

rocky1986 16Aug2006 15:27

Re: File System Simulation In C
 
Quote:

Originally Posted by shabbir
But you can have a file system which can contain other files. Say your virtual system can store some config files which cannot be accesed but just for viewing purpose you have API's
Simple is start off with having some files into a filesystem file and allow the access based on accesssebility.

yeah i know but the problem is how to implement (which data structure ?) this virtual disk ??

it should have many components(boot block,inode list,files etc) so using a structure would be appropriate but you cant store a struct on your actual file system.It is not persistant like file is.

but you have problems with using file as well..

shabbir 16Aug2006 16:02

Re: File System Simulation In C
 
You need to have structure and then have methods to make it persistents on file.

Triteo 14May2009 08:40

Re: File System Simulation In C
 
Problem with emulation of file system I solved with BoxedApp SDK.

StarDrago 27Jan2012 03:55

Re: File System Simulation In C
 
Are there yet any similar SDK for emulation file system ?


All times are GMT +5.5. The time now is 07:57.