4 ms·
Correction: streams are files. Everything are files.
by burgerbrain 16y ago
Correction: streams are files. Everything are files.
- jasonwatkinspdx 16y agoRather than just being snarky why not correctly correct the post by mentioning named pipes?
- burgerbrain 16y agoNamed or anonymous, pipes are still just types of files. "Everything is a file" isn't snark, it's a saying almost as old as unix itself.
- jasonwatkinspdx 16y agoI'm well familiar with the expression. However it's not helpful to someone who isn't already familiar. It's another form of "you're doing it wrong" without explanation.
- burgerbrain 16y agoIt's an intellectual teaser. You read it and think to yourself, "well this can't possibly be true, let me look into this further". Then you learn.
- cema 16y agoDo you expect people to "look into it further" with everything they think cannot be true? I would not.
- burgerbrain 16y agoIf they have any interest in the topic in the first place? Of course. I certainly did, so many years ago...
- rbanffy 16y agoIt also serves to separate the curious from the non-curious. Getting everything wrong is a fact of life and can happen to anyone.
- brndnhy 16y agoI think the commenter is simply clarifying that the file has been a universal way to represent almost every resource in Unix since its inception.
- jpr 16y agoIf "everything are files", then the whole concept of "file" is completely meaningless.
- mpk 16y agoWelcome to unix. Enjoy your stay!
- arctangent 16y agoNot really. It's a completely different statement than "everything is rocks". If everything is a file then everything shares properties common to files. It turns out that this is really useful. If everything were a rock then... well, let's say that it would not be so useful :-)
- jrockway 16y ago"Everything is a file" is the biggest myth of UNIX. Everthing is represented by an integer that we call a "file descriptor", that's true. But try calling "accept" on a file descriptor you made with "open", or try calling "sendfile" on a pipe instead of a socket. Doesn't work. Everything is an integer.
- burgerbrain 16y agoThose integers don't mean anything unless they are actually file descriptors, so the statement "Everything is an integer." is inaccurate. And of course there are different sorts of files... everybody knows that.
- haberman 16y agoEverything except directories, network interfaces, processes, memory mappings, System V IPC, capabilities (capget(2)), and signals, to name a few. If everything was a file, Linux would have like 10 system calls total.
- jerf 16y agoSee Plan 9: http://lwn.net/Articles/137439/ http://lwn.net/Articles/137439/