File IO is an essential operation that computers depend upon. It allows the computer to access data stored in files and use or update it. Common ways to interact with file data is reading, writing, or transferring. Often the data transfer occurs in 64 bit chunks, the process affecting the computer’s performance considerably due to it requiring reading and writing data across components, consuming cpu cycles.
Every computer tick the computer goes through the fetch execution cycle in which it retrieves an instruction from memory, decodes that instruction, or executes that instruction in a loop. This happens constantly in the pattern: fetch, decode, execute. The computer does the cycle billions of times a second, which is what it means for a computer to run in gigahertz. These instructions are stored in the form of binary.
The data itself is also stored in binary. Typically, the front of the file, called the header, contains the metadata, which is data about the data, such as the dimensions of an image stored or the bytes per second for an audio file. These files are stored in the computer in an organized hierarchy. In the computer, a root directory file contains the information on the location of all files, as well as metadata on the files like date and owner of the file. In file systems, the storage is broken up into blocks. This allows a file to be broken up and stored across many blocks, which allows the file to be expanded as needed by adding more blocks. These blocks are then brought into contiguous memory in a process called defragmentation in order to optimize the storage. In the hierarchical file system, the root directory points to other directories, which may store more directories and files. This allows for unlimited depth for the system as well as easy movement of files by simply changing what directory it belongs to instead of actually transferring data.
In an OS, the file system access is controlled by permissions. For windows, NTFS (New Technology File Systems) permissions are applied to each file. These permissions control the read, write, modify, execute, and other accesses to files. Typically, these permissions are inherited from the root folder and passed down to the sub folders. These permissions are assigned in the properties of the file. The equivalent for this for MacOS would be APFS (Apple File System) and the ext4 system for Linux, which both serve similar functionality.