file system
Mechanism for storing & retrieving computer data
A file system is a conceptual framework for information storage and retrieval on a computer. File systems provide a more human‐ and application‐friendly interface for navigating the data present on a storage medium.
§ The Basic Idea
Suppose you have a 🌈 massive gay crush ⭐️ on your best friend 👭 and you want to make them a mixtape to let them know how you feel. Your friend doesn’t have access to a music streaming service, but they do have a cassette player, so you plug the audio out from your computer into your tape deck and record a carefully cultivated selection of songs from Spotify, taking care to pause ⏸ and restart recording ⏺ whenever you hit a commercial. In constructing your mixtape, you are recording information on a storage medium, and this is approximately what happens inside your computer every time you save a file.
However, if you just pull the cassette tape out of your recorder and hand it to your friend, they won’t have any idea what is on it. If, later, they decide they want to listen to a specific song, they won’t know how far to fastforward ⏩ or rewind ⏪ before it starts. Even though recording the information was relatively easy for you, for your friend, retrieving it is hard.
You can make life easier for your friend by preparing a list of start and stop times for each of the songs on your mixtape. You might also annotate this list with helpful bits of information, like « this song reminds me of you ♡ » or « remember when we danced? ». This list of songs forms a rudimentary file system for your mixtape and makes convenient information retrieval possible.
At their most basic level, all file systems operate like your list of songs for your friend:
They provide a computer with start 🔜 and stop 🔚 positions for all of the files on your hard drive (or other storage medium).
However, file systems have another important purpose, which is to provide useful information to you (the user of the computer), and to programs acting on your behalf.
Most file systems conceptually organize files into a tree structure for your benefit, with “folders” or “directories” 📂 comprising all of the branching parts of the structure, and “files” 📄 making up the leaf nodes.
Tree structures let you remember the location of files in terms of their “path” through the structure, so you can say “file solong_gaybowser.png
is in /Users/me/Pictures/funny/
” instead of “file solong_gaybowser.png
starts at byte 420 of block 69 and continues for another 2048 bytes”.
With modern advancements in computers giving you things you didn’t ask for (and also some things you did), it’s less important for people today to remember the exact paths of files in their file system, because they can just ask the computer to find the file for them whenever they forget. This is fine if you are a living being, capable of providing responsible feedback like “this isn’t the file I was looking for” 🤖🙅. Programs generally do not have this capacity, and so understanding the file system is very important for anyone who is doing any programming.
§ Types of File Systems
Because the people who make computers can never agree on anything, there are lots of different types of file systems. Some kinds of file systems include FAT, exFAT, NTFS, HFS+, APFS, ext4, and ZFS. Thankfully, most operating systems abstract away the exact particularities of the underlying file system and provide a single virtual file system for users to interact with. For example, people using Unix typically do not need to know what kind of file system their storage media uses, so long as they are comfortable with the virtual file system that Unix provides.
§ The Unix File System
This section still needs to be written…