Ok you got me with this one.
Btw the mitochondria are the powerhouse of the cell.
Ok you got me with this one.
Btw the mitochondria are the powerhouse of the cell.
In Windows land, it's HANDLEs...which is typedef void* HANDLE IIRC

It makes more sense when you realize that it's not that everything is files it's that everything can be treated as a file. There are other APIs to interact with things, but everything can be interacted with as if it was a file. It doesn't seem as bonkers like this.
Files don't actually exist once you dig down
Yeah, it sort of depends on the definition of the word file. "File" in the sense that it can be interacted with like a file versus "file" in the sense that it's data on a disk. But then, if you're really thinking about it, data on a disk isn't a file, it's data, and we can just interact with it like a file.
Exactly. A file is really just a way to understand a collection of bits. So saying everything is files is like saying everything in computers can be described as sets of bits, which is not a terrible heuristic.
Stages of POSIX enlightenment:
Most people stop at stage 2, stage 3 hits when you decide to write a filesystem, stage 4 when you've finished your first filesystem. Stage 5 is when you start working on kernel internals. No one can tell you how to reach stage 6, you must discover it for yourself.
true enlightenment: everything is a string over an IO socket
/dev/null sez nothing is also a file
Asking for a friend.
If you can recognize "nothing" then "nothing" must be something right? So if nothing is a file, because /dev/null says so, then nothing MUST be something to be a file. And therefore /dev/null can't be nothing.
Or do I just need more tea? Or maybe whisk(e)y?
The word "nothing" isn't itself nothing. It is something used to describe nothing.
The word "nothing" is the English word describing the concept of nothing. And I have to use the word to describe the concept. So yes, you are correct the word is itself "something". So that is probably one point for "nothing" to not exist.
I have now consumed 3 cups of tea. And my head now hurts from thinking about nothing. I should never have stepped into this post.
in fact that gets used in abstract mathematics to first introduce the natural numbers. the empty set (nothing) (which you define as 0) is not itself nothing, so you can define the set that contains just the empty set, which now is not empty itself, but contains one element, so you define that as 1 ...
Am I a file?
Missing stage 7: Not everything is a file.
Linux is closer than other *nixes (sysctl equivalents in some platforms are not files, but they are files in Linux).
However get very far into network and the file-like behaviors become more limited. From an application, at least you have a decent chance of having unseekable, but otherwise 'file-like' interaction with stream protocols. Then you need recvmsg/sendmsg. Then you want to deal with low level interaction with the network stack and dealing with NETLINK and such..
Unfortunately, no one can be told what a file is. You have to see it for yourself.
This is your last chance. After this, there is no turning back. You take the blue pill - the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill - you stay in Wonderland and I show you how deep the file system goes.
And the hidden 0th level that you only get after being nearly killed by a falling server rack:
"Files Aren't Things"
Which looks great on a tshirt, btw :p
"How can files be real if the filesystem isn't real?" - Jaden Smith (probably)
But what about the fotoes?
I suspect sarcasm but in case it is not, photos are just binary files, just like videos and many other file formats.
Yep, takes a moment to wrap your head around but the longer you read linux/unix documentation, the more it makes sense why it is the case.
top 50 comments