6 ms·
File extensions are a kludge anyway. (And Windows 10 still hides them by default, because hey, backwards compatibility, and you wouldn't want to confuse Grandma
by bellyfullofbac 6y ago
File extensions are a kludge anyway. (And Windows 10 still hides them by default, because hey, backwards compatibility, and you wouldn't want to confuse Grandma who's seen the file be called "grandkids" since Windows 95..).
Why should the filetype be dependent on the name? People even think renaming a .BMP to .JPG means now it's a compressed file!
Old school Macs stored the filetype outside of a file, so you can rename the file "grandkids.mp4" and double-clicking it would still open it in the image viewer.
- throwanem 6y agoNot really outside. The metadata was stored in a so-called "resource fork", with the file contents proper in a "data fork", both of which belonged to the file per se. Part of the resource fork was the "creator code", four bytes identifying the application which had created or could open the file, and the "type code", four more bytes defining which, among the potentially many kinds of files a given application could open, this file actually was. Binaries were stored in the same format, with IIRC an extra bit somewhere flagging them as executable. Classic Palm OS used an identical scheme, and for both platforms there was a freeware "ResEdit" application you could find to let you edit resource forks without paying for a real developer toolkit.
- greggman3 6y agoYes, and it sounded great on paper but was horrible for interoperability because a file was not self contained from the POV of filesystems that didn't support the resource fork. Every file you wanted to distribute cross platform needed 2 versions. One with all that metadata bundled up for Mac, one without it for everything else. It was a nightmare OS-X dropped it for good reason.
- throwanem 6y agoYeah, it was painfully overcomplicated for sure - Palm OS did it much more seamlessly for cross-filesystem interop, but it was only when SD cards and /Palm/Launcher came along and you didn't really need Hotsync any more that it really got comfortable. It was very much of its time and I don't regret that it's gone, but it was certainly a clever and interesting design.
- Qwertious 6y ago>but was horrible for interoperability This makes me sad - it was dropped because of problems with other operating systems, not because it was necessarily a bad architecture. I understand why they would do it, but it makes you wonder how much better our systems could be if it weren't for concerns about legacy.
- Someone1234 6y ago> This makes me sad - it was dropped because of problems with other operating systems, not because it was necessarily a bad architecture. No, it was dropped because it was designed without enough forethought given to how that metadata would be transmitted over the wire or when multiple files were bundled consistently. Even if every OS used this scheme a better solution to these problems would have to have been devised. Are extensions perfect? No, they suck. But yet solve this metadata transfer problem "good enough" and therefore won the war. PS - There was also a lack of user management tools/feedback on a lot of systems, for example changing the "file type" was often impossible out of the box, and the file types often unclear unless you went into details/properties on purpose (a potential security headache, up there with hidden extensions ala Windows).
- efreak 6y agoMicrosoft removed the file type manager in Vista(?), so it's no longer as simple to change what software opens arbitrary file extensions. You now need to have a file with the extension you want to change the default for, use 'open with', and check the 'use by default' button. If you want to change a bunch of file types by copy/ pasting exe path, sorry, you can't do that without editing the registry. And the new method of changing programs that open groups of file types (ie documents or html), the program you're running needs to be registered as something that can do so, or it won't appear in the list. Want to change all image formats except gif (jpg, png, tiff, bmp, wmf, emf, and so on) to a different image viewer? Your options are to change them all then change gif back, or to change them individually. I think there's a location in the new settings for listing all file type associations, but it still doesn't allow copy/pasting paths for multiple fast modifications. If you want to change the name of a file type as it appears in the file type column in explorer, or want to change the icon used for a type of file to something other than that of the application used to open it, that's no longer possible without editing the registry.
- sircastor 6y agoI was in my tweens/early teens when I learned about ResEdit. I thought it was some kind of hacker tool, and I was amused at the various things I could change.
- mike503 6y agoI used to add menu items (that didn’t do anything), I was able to change picture/icon resources inside apps, all kinds of fun stuff. Change command mapping, etc
- throwanem 6y agoChanging app icons was the big thing for me. I learned about that as a tiny child at computer camp, and I thought the high school kid who introduced me to it must be just about the coolest guy in the world.
- ksherlock 6y agoThe file type and creator type are stored in the Finder Info meta data which is in the file record (along with the creation date, file size, etc).
- amyjess 6y agoType and creator codes were stored in the desktop file IIRC, not in the resource fork.
- agumonkey 6y agoi always found that a bit funny to see the 'typing' hygiene vary between OSes just like between programming languages. Windows let you cast anything, MacOS.W had the application being the sole type constructor in a way. Very functional.
- deleted 6y ago[deleted]
- userbinator 6y agoOn the contrary, it's a simple and explicit (when not stupidly hidden...) way of denoting the file type, which is great for interoperability and information interchange. Proprietary, opaque mechanisms like resource forks only serve to keep users uninformed (and thus unlearning) and impede the free interchange of information between different applications.
- cbhl 6y agoI do remember resource forks, but I thought content-detection was also a generally accepted pattern on 90s-era Macs because of the lack of file extensions? (If you had a safe content-detection code-path -- admittedly a harder thing to guarantee these days -- that could certainly be safer than relying on users to not "open grandkids.bmp.exe" or "rename a downloaded.txt to autoexec.bat".)
- Wowfunhappy 6y agoI don't actually think file extensions are such a bad system. Filenames exist to provide context for the data inside. "Draft 2020 Quarterly Report.txt" and "Draft 2020 Quarterly Report.csv" could contain the exact same data, but the file extension indicates how the file is intended to be used, just as "2020" indicates the relevant year and "Draft" indicates completeness.
- kalleboo 6y agoThe cool thing about the Classic MacOS file type/creator system is that you what app opened a file was not dependent solely on the file type, but also on the app that created it. So if you downloaded a GIF file of a cute cat, it would open in your image viewer, but if you were working on drawing your own GIF image, it would open up in your image editor.
- medstrom 6y agoBut we have file timestamps, permissions and other attributes. There could easily be a "file type" field too, that seems more natural than shoving this metadata into the title.
- Wowfunhappy 6y agoAs I see it, a timestamp is "non-negotiable". The file was last modified on April 22, 2001. There's no difference of opinion, the time is what it is. But the file extension partially reflects a user's intentions. A stylesheet named "style.css" is intended to be used by a browser directly, whereas one named "style.scss" is expected to go through a preprocessor, but the two might have the exact same contents, and I might decide to just change one to the other, and that's okay. I take your point about permissions, which are expected to be set by the user. Of course, I actually run into problems caused by incorrect permissions all the time. Maybe it would be better to encode those in the file name! (Although I don't know how you'd do it without creating a mess, and potentially security issues.)
- IshKebab 6y agoBut you could just name one of the files `Draft 2020 Quarterly Report CSV`. That's a terrible reason to use file extensions.
- aflag 6y agoIt would be kind of neat if changing the extension of a file caused it to be converted automatically. It would save a bunch of typing and browsing around. Just rename a directory to foo.tar.gz and it gets compressed and tarred. I'm not saying that the kernel should be doing that, but it feels like a nice abstraction for some UI.
- amelius 6y agoBut why tar it in the first place? If you want to share a directory, the system can tar it for you behind the scenes. Also, the system can zip anything behind the scenes, without the user knowing.
- aflag 6y agoI guess it would make sense if you want to archive it and save some disk space. It also not always clear to the system that you are sharing a directory, if you drop it on a network drive, for instance. But yes, I think zipping a directory is not the most compelling use case.
- BlueTemplar 6y agoAmazing idea !
- scpedicini 6y agoThis is one of those ideas that seems nice in theory but in practice would just lead to so many subtle problems especially if it happened automatically. Lots of programs create temporary files by changing the extension temporarily but if the kernel were attempting to intercept and change the internal data you could never guarantee the state of your file data. Not to mention potentially renaming an extension to an automatically handled extension and having that data irrevocably altered without you even realizing it. Then of course there's the fact that there are usually lots of options associated with converting a file. Jpg needs visual compression levels, mp3 needs bitrates, etc.
- grishka 6y agoIn the age of the internet, file extensions are a good idea, they should be visible by default, and people need to learn to recognize them. There's a lot of malware that gets people to run it by being an executable with an icon of an innocent file type, like an image. If you don't see extensions, you have no idea it's an .exe instead of a .jpg.
- alfiedotwtf 6y agoThey’re also dangerous too! I remember seeing malware as an attachment to an email with the file name “somefile.exe.bmp”, which looks safe, but when saved on Windows, it saved it to disk as “somefile.bmp.exe” because there was some Hebrew character that flipped the last two extensions around!