Live data from Hacker News

In Unix Everything Is a File

ph7spot.com

21–30 of 57 posts

Re: In Unix Everything Is a File

#21
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.

Imagine if unix was invented today and you would navigate a folder by reading it, and having a JSON encoded file of its content returned. Slow but so elegant and pretty.

Re: In Unix Everything Is a File

#22
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 know that SunOS 5.10 could read(2) a directory (that's what lore.cs.purdue.edu was running).

Re: In Unix Everything Is a File

#24
post #11
post #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…

Consider trying rsync instead of scp - I've found it to be faster for multiple small files.

I love rsync, but being exceptionally fast is most certainly not one of it's properties.

Re: In Unix Everything Is a File

#26
post #10

Any UNIX old timer knows that actually: In UNIX everything is a file, except when it is not.

> In Plan 9 , everything is a file Fixed that.

> > In Plan 9, everything is a file > Fixed that.

It was a short snarky comment. Also the article mentions that too at the bottom.

Yeah they "fixed it" but by that time not enough people cared. The abstraction purity was nice and developers and OS fans loved it, but it just didn't matter for most application. Another way to put it is that Linux was already fairly decent and it wasn't worth switching to a whole new OS just to have everything be a file.

Another obstacle was that Plan 9 wasn't marketed or pushed enough. Imagine if Google backed Plan 9 and pushed it as the Android OS, put it on Chromebooks, updated it regularly etc. That would be enough for people to switch to it.

Re: In Unix Everything Is a File

#27
post #21
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.

Imagine if unix was invented today and you would navigate a folder by reading it, and having a JSON encoded file of its content returned. Slow but so elegant and pretty.

If unix was invented today, you would have 3rd party files everywhere, executing randomly and typing the newest offers to your prompt automatically.

Re: In Unix Everything Is a File

#28
post #26

Earlier quoted context omitted.

> In Plan 9 , everything is a file Fixed that.

> > In Plan 9, everything is a file > Fixed that. It was a short snarky comment. Also the article mentions that too at the bottom. Yeah they "fixed it" but by that time not enough people cared. The abstraction purity was nice and developers and OS fans loved it, but it just didn't matter for most application. Another way to put it is that Linux was already fairly decent and it wasn't worth switching to a whole new OS…

As we discussed the other day, there was still some issues with stuff like graphical performance with such a concept, suitable for gaming and such.

In any case, Inferno with Limbo would be much better, and to pick on your example not much different from Android's architecture.

Re: In Unix Everything Is a File

#30
I like the Linus Torvalds' interpretation: that (almost) everything is actually a file descriptor. The few things that are not, like fork() returns, are subject to criticism (DJB wrote about how fork() should return an fd, I just couldn't find the URL right now.)
Post reply on HN