3 ms·
Agree completely; the problem is that a clever-sounding slogan like "everything is a file" is so appealing to people that they want to believe it even if it's n
by haberman 13y ago
Agree completely; the problem is that a clever-sounding slogan like "everything is a file" is so appealing to people that they want to believe it even if it's not actually true. I've run into this before: https://news.ycombinator.com/item?id=2397039 https://news.ycombinator.com/item?id=2397039
Here's another similar example of how "everything is a file" falls down that I wrote about in 2005 when complaining about terminals (http://www.advogato.org/person/habes/diary/6.html http://www.advogato.org/person/habes/diary/6.html)
Then there's the whole mess of pseudo-terminals.
If you are like me, you might wonder at first why
pseudo-terminals are necessary. Why not just fork
a shell and communicate with it over stdin/stdout?
Well, the bad news there is that UNIX
special-cases terminals. They're not just
full-duplex byte streams, they also have to
support some special system calls for things like
setting the baud rate. And you might think that a
change of window size would be delivered to the
client program as an escape sequence. But no, it's
delivered as a signal (and incidentally, sent from
the terminal emulator as an ioctl()).
Of course, you can't send ioctls over a network,
so sending a resize from a telnet client to a
telnet server is done in a totally different way
(http://www.faqs.org/rfcs/rfc1073.html)
- cmccabe 13y agoLet's not confuse a bad implementation with a bad philosophy, as a lot of these comments seem to be doing. Also, "everything is a file" is still true even when some files have additional operations possible on them. It's misleading to say otherwise.
- munin 13y agoso I think that in an abstract world of arbitrary reality, stating "everything is a file" is okay but we have a lot of evidence that implementing something where everything actually is a file is just too hard. If the philosophy is good, why do its adherents produce so much that is crap?
- valleyer 13y agoWell, for the PTY example above, the reason is backward compatibility. Eventually we need to decide to rid ourselves of the limitations that backward compatibility (with, e.g., bash) brings and clean up the implementation.
- jfb 13y agoI'm not even sure that "everything is a file" is particularly appealing as a philosophical position.