-
Notifications
You must be signed in to change notification settings - Fork 3
Feature request: Utility to retrieve legacy Mac OS’ type & creator codes #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think the use of the FourCC Mac OS file type and Creator code have been deprecated a long time ago. For instance, if I create a brandnew file "untitled text.txt" with BBEdit, I get:
i.e. null values, where I had expected "TEXT" and "BBEd" (I think). I sampled also a lot of files from my local mac and I find primarily "\0\0\0\0" and " " (4 spaces), but very litte true FourCCs, and if, only from very old files. So, let's explore this:
where the
will give you
will give you The only thing this snippet doesn't do is convert non-printable characters (like 0x00) to something readable (like \0). |
Awesome! Type and Creator codes are indeed ancient, and I happen to have archived plenty of files from decades ago, with no file extension as was the practice on classic Mac OS, so I wanted to document that by extracting those codes. And it works as you described. Thanks! |
Ah, yes, that is a very valid use case! - and with the information add the proper file extension to the file name so the file type becomes explicit and visible from the file's full name. Hopefully, the files are still supported by today's software. I have found many (very, really) old files whose data was saved in the Resource Fork at the time, and somewhere along the way got lost. These files would have the creator and file type, but are (and were always) zero bytes long in the Data Fork (but relax, there wouldn't be code around to do something useful with these files anyway). For other files (Framemaker pops to mind, as an example), the file data does exist in the Data Fork, but, again, there is no code around to do something with it. I hope for you these were TEXT files, because these will still be readable (mind the MacRoman character set, though :-). Good luck. |
Well, in the case of legacy Mac fonts, that’s actually how it’s supposed to be! (i.e. empty Data Fork, everything in the Resource Fork). DSM’s SMB server, when accessed from a Mac, abstracts however DSM stores the Resource Fork in @SynoResource so they are still accessible from Mac clients. Bulk converting those suitcase files ( |
It ended up not being so straightforward. @SynoResource files seem to be in the AppleDouble format and, depending on the file, type and creator codes might be in their Finder Info block, their Resource Fork block or both, so simply targeting a specific character position will not always work. Here are a couple of scripts (Bash and Python, the latter being MUCH faster so being the recommended one) to get legacy Mac OS file type and creator codes from files stored on a Synology NAS running DSM. On another note, on macOS, |
The utils at extended-attributes-and-tags do not seem to be able to extract legacy Mac OS’ type & creator code of a file, and it would be useful if one could locally.
macOS stores legacy type & creator code inside the extended attribte
com.apple.FinderInfo
and one can specifically query them with/usr/bin/GetFileInfo -t <file>
and/usr/bin/GetFileInfo -c <file>
respectively.DSM seems to store them inside @SynoResource files.
The text was updated successfully, but these errors were encountered: