Hacker News new | ask | show | jobs
by anal_reactor 14 days ago
> 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.

2 comments

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