Hacker News new | ask | show | jobs
by amelius 2580 days ago
Instead of calling everything a "file", you might as well call everything an "object" then. It also seems more correct.
3 comments

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.