Hacker News new | ask | show | jobs
by nofriend 16 days ago
Some file formats, eg png, require a particular file header in order to be considered valid. This is true regardless of your operating system, be it windows or linux. If that is hidden information, then it is hidden regardless of which operating system you're on. On windows, if I have a png named .doc, then there is absolutely no way to determine that it is a valid png and could be opened with my image viewer with standard tools. On linux it will recommend you open the file with an image viewer regardless of the file extension. That seems to me like significantly less hidden information.
1 comments

> On windows, if I have a png named .doc, then there is absolutely no way to determine that it is a valid png

And that's a good thing. Imagine receiving a file called "very_funny_cat.png" and Linux realizing that while it's not a valid PNG image, it is a valid ELF executable.

The sane option would be to change the file explorer to have a column/field of "What type of file we've detected it is". We already do this for directories. Nowadays we just rely on naming convention that the last 3 letters of the name identifies correctly what the file format is.
Right, linux should instead go by the normal extension for an elf, which is no extension... instead this problem is solved by prompting the user if they want to execute the program.
> instead this problem is solved by prompting the user

it is solved by informing user how the file will be used

aka file type