4 ms·
"Everything is a file" is one of the most misunderstood concepts I encountered, to the point where people think that disk IO is involved. A file doesn't even ne
by clktmr 7y ago
"Everything is a file" is one of the most misunderstood concepts I encountered, to the point where people think that disk IO is involved. A file doesn't even need a filename (eg sockets).
The main point is to have a common interface for system resources, which happens to be the file api in Linux. Think of it as the base class of everything. There is a bunch of tools/code that operates on file descriptors, which you can reuse now.
Build better interfaces on top of that if you want to.
- discreteevent 7y agoEverything is a bytestream.
- wbl 7y agoSockets depart badly from that model with special purpose setup syscalls.
- clktmr 7y agoYeah but that's rather because the socket api is older than Linux. Underneath there is the sockfs implementation.