I am attempting to learn more about C and it's descendants(C++ mainly). I have decided that I would like to create a "file system" of sorts. Not a particularly advanced one mind you but something to play with. I have no intentions of making it mountable, securable or even recoverable.
At the moment I am stuck in concept land with trying to decide how to implement the MFT/FAT.
At first I thought that I would just use the first X number of bytes to store a lookup table, when I realized that there would then be a limitation to the number of files I could store I thought maybe use some type of metadata with each file but then I would have to scan the entire filesystem to locate a file.
I have read through this and this although the z80 link seems like it is more up my alley.
From a high level I want to be able to issue a command like:
./myfs funnycat.jpg mystorage.mfs
Essentially appending binary data to the end of mystorage.mfs
How can I store the information that would contain the file names, start offset and length while avoiding the issue of self imposed limits (lookup table length) or having to scan the entire file (metadata with binary data)?
Concise Explanation I am looking for a way to label binary data stored in a single contiguous file so that I can pull data from a given offset range or by string.
./myfs mystorage.mfs funnycat.jpg
Likely in order to accomplish this I will add some logic to myfs to check the first argument for signs that it is a blob containing other files or not.