hi every body i'm having a project of a virtual file system
where it consists of 4 logical parts
1)VFS super block containg information about the next 2 parts and general information about the system like no files,.....
2)FAT
3)FreeBlockList(FBL)
4)a space containing the physical blocks and theier extensions
where i should have a free block list containing the addresses(pointers to those blocks) of the free blocks (where the block of data is 1024 byte) in the VFS
and a file allocation table FAT which have saome of the parameters of the stored files like their size their location on memory etc;(also thier location as i think is just pointer to thier location)
i should use data structures concepts or even full implementaion like queues. linked lists and some of these stuffs
so i think that as i'm gonna take an address from the FBL every time i add new file and delete that block address from FBL and put it in FAT
so i make it as a queue of pointers but i tried several ideas for the FAT and didn't really got it so any suggestions alli had in mind is that it should have a structure of pointer , size , modification date etc
so should it be a list of structure????? aqueue of structure??????
or what????????????
It should be a linked list of a structure.
Remember that when you delete a file, the matching file entry is likely to be somewhere in the middle of the FAT, so you need to be able to remove them efficiently. A linked list allows this.
A queue is unsuitable for this as its whole point is that you're supposed to remove only the oldest elements.
@Athar :
thanks for your reply
but i found a problem when i try to made a list or queue of structure
i made it as templated linked list then i try to make an instance of it as a structure of my own but it gives me an error
Uhhh... and the error is...? And the code?
You don't need to implement your own linked list, there is already std::list. Unless you aren't supposed to use that.
FAT: stores the list of files stored in the virtual file system
but do i need to store the pointers to the blocks in the FAT file stored on the hard disk
or i need to store the physical address of the blocks ??
and how to get the physical address of an item stored on hard disk???