Everything Is a File

paradigm Library and ArchiveData Processing

Categories: computer-sciencesystems-thinking

What It Brings

The master metaphor of Unix. Every resource in the system — hardware devices, network sockets, inter-process communication channels, and actual files on disk — is accessed through the same interface: a file descriptor that supports open, read, write, and close. The “file” (a named container of sequential bytes, borrowed from the office filing cabinet) became so dominant that it restructured how an entire operating system conceptualizes resources. Plan 9 later took the metaphor to its logical extreme: even the network and the window system are filesystems.

Key structural parallels:

Where It Breaks

Expressions

Origin Story

The “everything is a file” principle emerged from Ken Thompson and Dennis Ritchie’s design of Unix at Bell Labs in 1969-1971. The idea was not articulated as a grand philosophy at the time; it grew from practical engineering decisions. Thompson wanted a simple, uniform I/O interface, and the file abstraction — borrowed from the familiar concept of documents in a filing system — was the most natural fit.

The key innovation was the file descriptor: a small integer that serves as an opaque handle to any I/O resource. By making devices appear as special files in the /dev directory, Thompson and Ritchie ensured that existing file-manipulation tools (cat, cp, redirections) would automatically work with devices. This was a profound act of metaphorical extension: the filing cabinet expanded to contain the entire machine.

Doug McIlroy’s pipes (1973) exploited the metaphor further: if program output is a file and program input is a file, you can connect them. Linux’s /proc filesystem (inspired by Plan 9) pushed the metaphor into system introspection: process state, kernel parameters, and hardware information all became readable as files.

The metaphor’s success is measured by its invisibility. Most programmers do not think of “everything is a file” as a metaphor at all — it is simply how operating systems work. That naturalization is the hallmark of a paradigm-level conceptual mapping.

References

Related Mappings