Hacker News new | ask | show | jobs
by int_19h 2372 days ago
File extensions are the de facto type indicator on all platforms, not just Windows. Even when the FS has some other way to specify the type (e.g. a separate MIME type metadata field), the extension still normally sets the default value for that.

This is orthogonal to all that, though. It's about the UX to associate an app with a file type, regardless of how that file type is determined.

1 comments

doesn't Linux use libmagic?
What you're referring to as Linux is actually...

GNU/Linux doesn't automatically choose which program to use for anything (you can't ./file.png like you can in Windows). In my experience file managers tend to use file extensions to choose which application to use, and that application might then use libmagic and ignore the file extension. (e.g. giving a PNG file the .JPG extension will make the file manager think it's a JPEG, and therefore open it with an image viewer, but the image viewer program will use headers to recognise it as a PNG)

xdg-open ./file.png