1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

File System Simulation In C

Discussion in 'C' started by rocky1986, Aug 16, 2006.

  1. rocky1986

    rocky1986 New Member

    Joined:
    Aug 16, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    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 ?
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    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.
     
  3. rocky1986

    rocky1986 New Member

    Joined:
    Aug 16, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    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.
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    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.
     
  5. rocky1986

    rocky1986 New Member

    Joined:
    Aug 16, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    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..
     
  6. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    You need to have structure and then have methods to make it persistents on file.
     
  7. Triteo

    Triteo New Member

    Joined:
    May 14, 2009
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Problem with emulation of file system I solved with BoxedApp SDK.
     
  8. StarDrago

    StarDrago New Member

    Joined:
    Nov 12, 2011
    Messages:
    49
    Likes Received:
    2
    Trophy Points:
    0
    Are there yet any similar SDK for emulation file system ?
     

Share This Page