Here's a very simplified example. Note that I am using some made up notation here: "." represents NULL charcaters, and the numbers would actually be stored in hexadecimal.
The contents of 48 byte disk with a 7 byte file allocation table (FAT):
Notice that the FAT area contains the filename, a "9" representing the length of the file, and a "0" indicating the spot in the data area where the file begins. In fact, the file system might choose the put the data somewhere else, and that's absolutely fine. For example:
Represents the exact same contents with the file stored at an offset of 5. So say I want to delete this file now. A typical file system would do something like this:
Comments
Here's a very simplified example. Note that I am using some made up notation here: "." represents NULL charcaters, and the numbers would actually be stored in hexadecimal.
The contents of 48 byte disk with a 7 byte file allocation table (FAT):
Write a file named "blah" with contents "abcdefghi": Notice that the FAT area contains the filename, a "9" representing the length of the file, and a "0" indicating the spot in the data area where the file begins. In fact, the file system might choose the put the data somewhere else, and that's absolutely fine. For example: Represents the exact same contents with the file stored at an offset of 5. So say I want to delete this file now. A typical file system would do something like this: It writes a single NULL byte to the file system to mark the filename as empty, and the file is gone. None of the rest of the data is cleaned up.