3 ms·
I got me a copy of The Unix Programming Environment (1984) by Pike and Kernighan last year. It has plenty of hidden small design gems or anecdotes like this one
by vrnvu 4y ago
I got me a copy of The Unix Programming Environment (1984) by Pike and Kernighan last year. It has plenty of hidden small design gems or anecdotes like this one. For example, why files don't need a \EOF char, it's implicit when you don't read more bytes the you have reached the end of a file...
Unix design was about making things work (1) and simple (2).
- chasil 4y agoThis book is online for free (three cheers for exotic spelling at archive.org). http://files.catwell.info/misc/mirror/the-unix-programming-environment-kernighan-pike.pdf http://files.catwell.info/misc/mirror/the-unix-programming-e... https://archive.org/details/UnixProgrammingEnviornment https://archive.org/details/UnixProgrammingEnviornment
- cma 4y agoI wonder if \EOF was around due to punch cards? You maybe didn't want an implicit EOF in case you lost the last card.
- int_19h 4y agoEOF was around because many early file systems only recorded the number of allocated blocks per file, so some other mechanism was needed to record the precise length in bytes in cases where padding with spaces was not acceptable.
- bombcar 4y agoExactly - think about a tape with multiple files on it - you want some way of knowing you reached the end of a file without having to seek all the way back to some directory.