Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The concept of file extensions on windows is equally unintuitive (why is the type 9f.file dictated by what comes after a dot). It's just a question of what you're used to.


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.


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: