Engineer Atlas
OverviewLearnJourneysOS LabFinderRoadmapPracticeInterviewCheat SheetCompareConnections
OverviewLearnJourneysOS LabFinderRoadmapPracticeInterviewCheat SheetCompareConnections
Operating Systems
  • How Programs Run
  • Processes
  • Threads, Async & Event Loops
  • CPU Scheduling
  • System Calls & Kernel Mode
  • Stack & Heap
  • Virtual Memory & Paging
  • Files, File Systems & Descriptors
  • I/O
  • Concurrency, Synchronization & Deadlocks
  • Inter-Process Communication
  • Sockets
  • Containers & the OS
  • OS Internals Lab
  • OS Debugging & Capstone
OS + Networking
  • OS + Networking Together
OS/Learn/Files, File Systems & Descriptors
Operating Systems

Files, File Systems & Descriptors

Paths, files, directories, metadata, permissions, offsets; the descriptor table; how a path becomes blocks on storage; inodes on Unix-style systems.

The question this module answers · What is the difference between a filename and a file — and what is FD 3?
Files, Paths and Names

A filename is a directory entry that points at a file object; the object has metadata, permissions and blocks, and it can outlive — or have several — names.

File Descriptors
▶ interactive

A descriptor is a small integer indexing a per-process table whose entries point at system-wide open file descriptions (offset, flags) which in turn point at file objects — and on Linux sockets, pipes, timers and epoll instances are descriptors too.

File Systems: From Path to Blocks
▶ interactive

A file system turns a path into directory lookups, metadata, and a map from byte ranges to storage blocks, tracks which blocks are free, and uses journaling or copy-on-write so that a crash halfway through an operation does not leave garbage.

Inodes
▶ interactive

On Unix-style file systems the inode is the file: a fixed-size record holding mode, owner, size, timestamps, link count and the block map — everything except the name, which lives in directories that point at it by number.

Engineer Atlas
GitHub·LinkedIn