News for hackers. Stuff that matters.
Re:Logs Are Streams, Not Files by burgerbrain on Friday April 01, 2011 @01:08PM (#2397039)
Correction: streams are files. Everything are files.
Re:Logs Are Streams, Not Files by jrockway on Friday April 01, 2011 @06:10PM (#2398298)
"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.

Re:Logs Are Streams, Not Files by burgerbrain on Friday April 01, 2011 @06:27PM (#2398366)
Those 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.

Re:Logs Are Streams, Not Files by haberman on Friday April 01, 2011 @09:39PM (#2398849)
Everything 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.

Re:Logs Are Streams, Not Files by jerf on Friday April 01, 2011 @10:19PM (#2398906)
Re:Logs Are Streams, Not Files by jasonwatkinspdx on Friday April 01, 2011 @01:40PM (#2397172)
Rather than just being snarky why not correctly correct the post by mentioning named pipes?
Re:Logs Are Streams, Not Files by burgerbrain on Friday April 01, 2011 @01:52PM (#2397223)
Named 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.
Re:Logs Are Streams, Not Files by jasonwatkinspdx on Friday April 01, 2011 @02:53PM (#2397505)
I'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.
Re:Logs Are Streams, Not Files by burgerbrain on Friday April 01, 2011 @03:45PM (#2397717)
It'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.
Re:Logs Are Streams, Not Files by cema on Friday April 01, 2011 @04:34PM (#2397915)
Do you expect people to "look into it further" with everything they think cannot be true? I would not.
Re:Logs Are Streams, Not Files by burgerbrain on Friday April 01, 2011 @06:25PM (#2398357)
If they have any interest in the topic in the first place? Of course.

I certainly did, so many years ago...

Re:Logs Are Streams, Not Files by rbanffy on Saturday April 02, 2011 @08:40AM (#2399802)
It also serves to separate the curious from the non-curious. Getting everything wrong is a fact of life and can happen to anyone.
Re:Logs Are Streams, Not Files by brndnhy on Friday April 01, 2011 @02:05PM (#2397284)
I think the commenter is simply clarifying that the file has been a universal way to represent almost every resource in Unix since its inception.
Re:Logs Are Streams, Not Files by jpr on Friday April 01, 2011 @04:40PM (#2397942)
If "everything are files", then the whole concept of "file" is completely meaningless.
Re:Logs Are Streams, Not Files by mpk on Friday April 01, 2011 @05:51PM (#2398243)
Welcome to unix. Enjoy your stay!
Re:Logs Are Streams, Not Files by arctangent on Friday April 01, 2011 @06:48PM (#2398440)
Not 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 :-)