3 ms·
When the Macintosh was introduced in 1984, files had a data fork and a resource fork[1]. The data fork was normal file data. The resource fork was an map of (OS
by osteele 8y ago
When the Macintosh was introduced in 1984, files had a data fork and a resource fork[1]. The data fork was normal file data. The resource fork was an map of (OSType, int16) -> data, where OSType[2] was a four-character resource type identifier such as 'MENU' to specify a menu, 'PICT' for picture, etc.
Sort of like MIME types, which were standardized a decade later[3].
Resources were limited to, I think, 4MB. 4MB was 32x the RAM capacity, and 10x the [floppy] disk capacity, of the original Macintosh.
One of the OSTypes was 'FONT'. Font data was simply a resource stuck in some file — the system file, or, as a kind of pre-web “web font”, an application.
When we added support for CJK fonts, around 1990, we had to also add OS/file system support for resource sizes > 4MB. (I think the limit was increased to 16MB.)
Resources were a clever invention that facilitated the development of GUI-heavy apps on what by today's standards are ridiculously resource-constrained computers. (The Apple Watch series 3 has more than 60,000 times the RAM of that first Macintosh — although only a third the screen resolution. :-)
Resources also enabled a limited kind of “view source”, that helped a generation of programmers learn their way around Mac application structure. You couldn't view the actual code source, but you could browse the GUI resources of any application you could get your hands on. (This is similar to do the modern web, where the use of webpack, Babel, uglification, and the use of compile-to-js languages, means the actual source code to a complex web site is not accessible, but the assets are.)
As MacOS 10.0, which built on the Unix- (Mach-)based NextOS, resources (multiple data within a file; one OS file per UI file) were replaced by Bundles[4] (many OS files — in a directory — per UI “file”). Bundles are a much better solution for a world with a heterogeneity of operating systems (macOS, Windows, Linux and other Un*xen), where files and tools need to port between multiple file systems. Although bundles come with their own portability problems[5].
[1] https://en.wikipedia.org/wiki/Resource_fork https://en.wikipedia.org/wiki/Resource_fork
[2] https://en.wikipedia.org/wiki/OSType https://en.wikipedia.org/wiki/OSType
[3] https://tools.ietf.org/html/rfc2045 https://tools.ietf.org/html/rfc2045
[4] https://en.wikipedia.org/wiki/Bundle_(macOS) https://en.wikipedia.org/wiki/Bundle_(macOS)
[5] https://productforums.google.com/forum/#!topic/drive/25XGSFtnGLk https://productforums.google.com/forum/#!topic/drive/25XGSFt...