Files and system-level input and output

Unix treats every device as a file reached through a descriptor, read and write can move fewer bytes than asked, and descriptors are shared through open file table entries after fork and dup2.

From Computer systems, a programmer's view.