by userbinator · 2y ago · 0 comments
That reminds me of Windows' NTFS "alternate data streams", which also got a lot of use by malware in an attempt to disguise its existence, and as a way to bypass access controls on web servers.
IMHO these "hidden features" are at the wrong level of abstraction and cause a lot of problems, information interchange among others. A file should be a single stream of bytes with a name. If you need another stream of bytes, create another file. If you need to group them together, that's what directories are for.
Windows has a resource format too --- it's just part of the program binary. There are likewise resource editors, one of which is also called ResEdit.
I think it does a great disservice to the Macintosh Resource Manager to focus on its implementation using a dual fork file system. What it allowed was a nice high-level interface to work with small pieces of data that hid away a lot of memory and disk management from the programmer - you just ask for a type and ID, and if it's in memory you get it right away, else it gets fetched, including asking the user to swap in the right floppy if they'd swapped it in. Afair it even purges things out of memory when they were no longer needed with no action on the programmers part - this is a big deal in 128k RAM.
There were some bad things about the implementation: it's easy to corrupt the resources of a file, for instance, and there's a fairly small limit to the size and number of resources. But having a way to access structured data that's a core part of the platform can be a great thing. If anything, the Mac didn't take this far enough.
Yes, on Windows it is part of the PE file, which is based on UNIX System V's COFF. These files have a list of sections used to distinguish between code, read only static data, read/write static data, optional debugging information, etc. The resources are just another section with the data in a particular format (probably not dissimilar in format to the Mac resource fork) and Windows has APIs to conveniently access the data.
But one thing this can't do is attach resources to arbitrary file formats. Thank you, that's a use case I was unaware of.
While I understand the appeal of this, the world would have been a lot simpler for a lot of stuff if (for example) every text file had tagged its encoding.
I wonder about if we could have moved forward as society a touch faster if Unix wasn't "all byte streams", and had a touch of metadata.
I feel like HTTP and friends shows we can just organically end up with a certain kind of structure that "works" (and at one point you have a spec, and then you can yell at programs that don't follow the spec)
We would've "moved forward" faster into authoritarian proprietary walled-garden dystopia, yes.