Skip to content

Commit bbcc714

Browse files
committed
everything is a file
1 parent 48e1f23 commit bbcc714

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

linux/everything-is-a-file.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Everything is a file
2+
3+
"Everything is a file" is an approach to interface design in Unix derivatives. While this turn of phrase does not as such figure as a Unix design principle or philosophy, it is a common way to analyse designs, and informs the design of new interfaces in a way that prefers, in rough order of import:
4+
5+
1. representing objects as file descriptors instead of alternatives like abstract handles or names,
6+
2. operating on the objects with standard input/output operations, returning byte streams to be interpreted by applications (rather than explicitly structured data), and
7+
3. allowing the usage or creation of objects by opening or creating files in the global filesystem name space.
8+
9+
The lines between the common interpretations of "file" and "file descriptor" are often blurred when analysing Unix, and nameability of files is the least important part of this principle; thus, it is sometimes described as "Everything is a file descriptor".

0 commit comments

Comments
 (0)