macOS retro post FullResForkDump (from long ago)

Organizing tasks to work on, New Features Ideas, Building LCS & LCB Libraries & Widgets, Redecorating and Modifying the IDE, Hacking / Editing Tools, Compiling the Engine from Source, etc.
Post Reply
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

macOS retro post FullResForkDump (from long ago)

Post by OpenXTalkPaul »

This was one of my first few posts 'over there' shortly after discovering that LiveCode existed:
https://forums.livecode.com/viewtopic.p ... 23#p102423
PaulDaMacMan wrote: Tue Apr 29, 2014 6:56 am So, I've really been getting into LiveCode lately and have set out to bringing my old Hypercard projects into this century. When I realized how much I relied on Externals (XCMDs/XFCNs) back then, I decided I would try to replace those externals with my own native functions and commands. I used a lot of Frederic Rinaldi's externals and did a lot of moving stuff in and out of the mac resource forks in particular (GetRes, resText, textRes, fullResSomethingOrOther). I found resfile:/ url syntax in the LC dictionary and had already been playing with binfile: parsing a bit, The end result was a stack that decodes / dumps all of a Mac files resource fork data into a field whilst labeling it and such. Parsing the res-fork raw based on some old scanned pages from "Inside The Macintosh". Half way though this project I suddenly found the copyResource, deleteResource, getResource, getResources, and setResource syntax in the LC dictionary! UH DUH!!! Wow, did I feel stupid and angry at myself for wasting my time, but decided to finish it anyway! Here it is, "FullResForkDump". If nothing else it is a good example of using the binaryDecode function.
This stack manually parses Resource Forks data from files created by macOS 'classic'/carbon.
Not real useful in 2024 but it does contain examples of reading binary data, using 'resfile://', binaryDecode, baseConvert etc.
ResForkDumper-final.livecode.zip
(3.97 KiB) Downloaded 8 times
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: macOS retro post FullResForkDump (from long ago and over there)

Post by xAction »

This should be useful on ,these themes they are all resource forks or .rsrc files, at least the useful parts of them are. Should theoretically be able to extract some PICT files to use in UIs when you want x-mas themed status bar or something

Oh joy another rabid hole Kaleidescope schemes

Can't believe I'm downloading stuffit expander after...12 years....and it didn't work.

Hmm and my resource theory didn't pan out, what are those theme files?
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: macOS retro post FullResForkDump (from long ago and over there)

Post by OpenXTalkPaul »

xAction wrote: Wed Mar 27, 2024 10:57 pm This should be useful on ,these themes they are all resource forks or .rsrc files, at least the useful parts of them are. Should theoretically be able to extract some PICT files to use in UIs when you want x-mas themed status bar or something

Oh joy another rabid hole Kaleidescope schemes

Can't believe I'm downloading stuffit expander after...12 years....and it didn't work.

Hmm and my resource theory didn't pan out, what are those theme files?
IIRC '.rsrc' I believe was some format used in the transition period from MacOS Classic to MacOS X, like the deprecated 'resource fork' data stuffed into the data fork.
But these Themes:
https://web.archive.org/web/20100906224 ... downloads/
Seem to be a mix of file types, they all seemed to have .icns (macOS X icons files) some had .psd (Photoshop) some had PDF etc. They seem to be OS X era stuff.
Kaleidoscope themes are from macOS 8/9 era, and so probably have data in the resource fork.

But the Engine already had syntax to handle data in resource forks.
copyResource function copyResource(file, destinationFile, resType,{resID | resName}[, newID])
deleteResource function deleteResource(file, resourceType,{resourceID | resourceName})
getResource function getResource(filePath, resourceType,{resourceName | resourceID})
getResources function getResources(filePath [, resourceType])
setResource function setResource(destinationFile, resourceType,[resID],[resName], flagsList, data)
I'm not sure if those functions still work in 2024, I haven't tried them since...ever?

More of a problem is resource forks are often discarded by various compression utilities (some gzippers) or from being transferred onto volumes or with transport mechanisms that don't support (or, like Apple, no longer support) resource forks. Apple deprecated them more than 20+ years ago.
Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests