Live data from Hacker News

In Unix Everything Is a File

ph7spot.com

1–10 of 57 posts

Re: In Unix Everything Is a File

#5
post #4

Which was the last Unix release/flavor where you could still read(2) a directory? All manpages that I've found say that you get EISDIR if you try it.

I certainly remember being surprised when I accidentally cat'd a directory on AIX and it worked. I can't remember exactly what you get back; I think it's a NUL-separated list of the files in it.

Re: In Unix Everything Is a File

#6
Is the sendfile system call still the fastest way to transfer data locally on Linux systems?

For communicating between processes running locally on system. Or, for example, a server running locally on an android device. Unix domain sockets typically beat TCP connections for most large file transfers. But is there anything faster?

And what about transfers over the public net from machine to machine? I usually just use netcat, ssh, or scp.

Re: In Unix Everything Is a File

#9
"Everything is a file" is a nice idea not taken far enough. The execution is full of frustrating omissions and holes at the edges, e.g.:

- unless you are using Plan 9 or gpm, reading mouse events is almost certainly going to be a lot more involved than opening /dev/mouse

- you can't portably use select() to wait on pthread conditions

- lots of useful things (like POSIX shared memory objects) are file descriptors, but aren't filesystem namespaced

Sometimes I wonder what the world would look like if Plan 9 had won.

Post reply on HN