2015 Macintosh Resource Forks

(written 5/18/2015)

 

 

Macintosh file systems have an aging system called "Macintosh Resource Forks".  This is a quick tutorial and explanation.

What is A Macintosh Resource Fork?

HIGH LEVEL SUMMARY: Mac resource forks are simply a flat array of bytes up to 16 MBytes long.  That's it.  16 MBytes can be specified in a 24 bit number.

This is a pretty good webpage describing them: http://en.wikipedia.org/wiki/Resource_fork
Here is a page saying you can upload resource forks using web browsers: http://support.softartisans.com/kbview_543.aspx

More information on Macintosh Resource Forks

Max resource fork size is a flat stream of bytes of max size: 16 MB = 16*1024*1024 = 2^24 = 16,777,216 bytes
 
Backblaze often uses and produces the "Apple Double" file format.  This is where the data file is in one file, and the Resource Fork is in another file side by side with it, which looks like this:
 
/pictures/puppy.jpg
/pictures/._puppy.jpg
 
SIDE NOTE: Apple *ALSO* has this thing called "FinderInfo" and the first 8 bytes of "FinderInfo" datastructure is Apple "type and creator". The standard "Apple Double" resource fork structure has space for it.  We support the "type and creator 8 bytes" because it is part of Apple Double. 
 
If you are on a Macintosh and end up with the above files, you can run a command line called "dot_clean" which combines the two files above into the one true file containing the data and the "resource fork".

 

How Do I Get A JPEG With A Resource Fork?

Let's start with this JPEG which was created on Windows and is 17,877 bytes long:

Somehow get this onto a Macintosh (copy it onto a USB Key with Fat32 filesystem, then copy that into the Macintosh's internal hard drive).  Now run a recent Photoshop.  Change it, like paint a red dot on the picture, and "Save As..." JPEG onto the local Macintosh's internal hard drive.  DONE!  (Photoshop creates thumbnails in resource forks.)  So now if you open a "Terminal" on the Macintosh and do an "ls -la@" in that folder, you should see something like this:

The file "girlFromWindows.jpg" does not have a resource fork.  The "girlRsrcFork.jpg" was created by Photoshop and has a resource fork.  Notice that the file size reported by the Macintosh for the file itself is only 40,232 bytes, but the resource fork is almost twice that size (83,989 bytes).  The "FinderInfo" is another thing that is supported by the "Apple Double" format - it includes things like "Type" and "Creator".  If you look in the Macintosh Finder, it looks like this (cannot tell they are different):

 

Now Copy File With Resource Fork to a Fat32 Thumb Drive - becomes "Apple Double"!

Now if you take that folder, you can copy it to a USB thumb drive formatted with the Fat32 file system.  When you insert that into a Windows PC, this is what you see:

What happened is that the file that contained a resource fork was split into two parts, where the name of the resource fork is "._girlRsrcFork.jpg".

 

Can I have Those Files Without Doing This Procedure?

Of course, here are the files zipped up for you:

  1. Zip Of the Apple Double Files (includes "._girlRsrcFork.jpg" file)
  2. Zip Of the Files Prepared Entirely on a Macintosh (OS X 10.9)

 

That's it!

Return to Random Stuff

Return to Ski-Epic home page.