This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

File System

Hi
May be my question seems to be Irrelevant to this forum but your answer can help me. I am making a file system it is working well in case of files but i donot know how to store directies in it. I searched a lot.
These things i know from research
1. Directories are saved in a similar way as the file are saved in the Root Directory Entry with a on directory bit in the attribute field.
2. There is "." and ".." pointers .pointer point to it self and ..pointer points to its parent.
but where they are saved in the name field???.
Where the parent address is saved (if it is saved in the starting cluster area then where the start of the directory is saved as i read it that subdirectory take at least one cluster)
thanxs
Regards
Farhan Arshad

  • This sounds very like working with the FAT filesystem.

    There are a number of implementations over the web (try searching in google - hint - look for home-built MP3 players).

    As far as I can remember, the entries for directories are the same as files, however, they are flagged up as directories (can't remember the exact method), and the pointer to the cluster on the disk points to the start of the new directory table.

    By default, FAT drives store two files in each new directory structure... these are "." and "..", where "." points to the start of the directory structure you are currently in, and ".." points to the parent. The names for these "dummy" folders appears just as though they were files, or other directories.

    Assuming that you're just reading the drive (a-la MP3 players), then these directory entires will be created for you by the OS that writes (windows?). If you need to write these, then you will have to create them yourself (since by the specification they don't have to be there). In this case, you will just have to be careful to maintain the cluster pointers while you're making the new directory entry.

    An old version of the FAT32 spec can be found on the 'net, and as I mentioned before, there's lots of home-grown implementations around...

    Hope this helps,

    Steve

  • FAT filesystem specification is available online:
    http://staff.washington.edu/dittrich/misc/fatgen103.pdf

    Not sure about IP rights/patents/etc. So use it at your own risk and don't be surprised if an army of Microsoft lawyers knock on your door :-)

    There are also many other filesystems, just look up "linux file systems". You can borrow some ideas from them as well.

    - mike

  • From what I've read in the past, Microsoft don't really care if you want to implement something that *reads* a FAT32 filesystem - or even *writes* to one...

    ...but if you want to format a blank device to contain a FAT32 filesystem, then you'd better have your cheque book ready...


    Steve