Yes, the computer only understands machine code. But the difference between types of files aren’t in the machine level, they are at the OS level, that is much higher.
When you open a file, you generally open it with another program (The OS generally has an application associated to the extension of the file, but you can try opening any file, with any program). The program that will try to make sense of that given data.
Let me show you an example:
Imagine you have a .jpg file (an image). When you open it through an application that can display images, the application will see that the data is on a .jpg format, and will decode the data using the rules to decode the 0s and 1s to a .jpg image, and then display the image on the screen.
But you can try opening it on a text editor. If you do that, you’ll probably see a bunch of random weird characters. What happenned is that the text editor will see only the 1s and 0s as well, but now the application is trying to decode that to a text.
Latest Answers