Hacker News new | ask | show | jobs
by delish 2581 days ago
Yes, people call it the "Unix philosophy" not the "Linux philosophy." And the Plan 9 folks (nee Unix folks) also thought everything in Unix should be a file and not everything was.

[edited for clarity]

2 comments

It is not the "Linux Philosophy", socket api originated from BSD and it is considered Unix. Based on my experience noone in the plan9 community would call it unix.
Socket API was bolted onto Unix as a port from TOPS-20. It might have become accepted part of Unix, but so was XTI which in retrospect was probably better.
Instead of calling everything a "file", you might as well call everything an "object" then. It also seems more correct.
Calling it object would mean you have different methods of accessing it. But files have a fixed set of methods/properties.
Not sure what you mean, because e.g. ioctl() call has many functions which are not sensible for regular files.

In any case, the article has 17 occurrences for "file(s)" versus 28 for "object(s)", so the author seems to agree with me :)

Not every file respond to ioctl() and that's not what people mean when they say "unix philosophy". Yes, in a sense ioctl() does model the object nature, but they aren't discoverable and rather adhoc, as the article points to powershell and capability for reflection for how a OOP based resource access would look like.
What's the difference?

Perhaps a file never meant just something you have in a directory, rather "a stream of bytes", and the bigger thing was always unifying the difference whether those bytes are read from a magnetic tape or received wirelessly over the internet.

A file is just an object with a name in a namespace. Without a name, it's not really very much of a file.
In Unix, some files even don't have names. See for instance the pipe() call.