This page is a wiki. Please login or create an account to begin editing.


12 posts / 0 new
Last post
IWishTodayWasStill2004's picture
Joined: 2012 May 25
__MACOSX troubles solved

There are many people here who have had issues trying to decode the .zip files with a __MACOSX folder on even Mac OS 9. However, it is just AppleDouble encoding using a modified style of file naming, in a .ZIP archive. Which is decodable by using Decode AppleFile v1.1 on Mac SSW 7.0 and later running on a Macintosh Plus or newer.

Here is an example diagram using a Classic Mac OS extracted Mac OS X zipped file:

ZIP _MACOSX Resources forked

MacZip, which also works on Mac SSW 7 running on a Macintosh II (but not on a Macintosh SE or Macintosh Plus), was found out to be able to extract the modern .zip format of the archives that the OS X Archive Utility.app creates.

So now, folks who have old Macintosh computers to which they can download files from the Macintosh Garden, but experience issues transferring files from their modern PCs to their old Macs or don't have modern computers at all, will now be able to fix these "__MACOSX-messed-up archives", themselves.

By itself, MacZip does not understand the __MACOSX/._*-style of preserving Macintosh Resource fork specific information in a .zip archive using AppleDouble, it only understands it's own XtraStuf.mac/*-style of AppleDouble or raw ZIP content. You'll still have to manually decode the __MACOSX-style AppleDouble by using Decode AppleFile once the archive has been extracted by MacZip, to complete the reconstruction of these MacZip expanded files.

Further instructions for doing this are located on the Decode AppleFile v1.1 and MacZip pages.

Comments

MCP's picture
MCP
Offline
Joined: 2010 Mar 12

On a related note, if using OSX earlier than 10.4, StuffIt Standard 8.0.2 can properly unzip those files, but of course that StuffIt version doesn't work in OS 9.

And of course if the zip is made of disk images of the right kind, the extra files aren't a concern at all.

Jatoba's picture
Online
Joined: 2018 Apr 16

It always made me confused whenever I saw those "___MACOSX" folders. I never knew it was something created only during compression-time, and that it was only for ".zip" files, and that too only for those created by Mac OS X's built-in Archive Utility / BOMArchiveHelper, and that it was exclusively meant for preserving the resource fork since ".zip" files are not wary of anything other than the data fork.

It's very cool to see Decode AppleFile 1.1 can handle the restoration of such files on the original Mac OS. Just gave it a try myself, and it works, by going to "File > Decode AppleDouble...", then first select the file within the "___MACOSX" folder and then the corresponding file from the other folder.

If someone has to rely on MacZip to decompress a ".zip" file on older Macs before they have the opportunity to restore the forks with Decode AppleFile, that's bad news, because it cannot handle many ".zip" files for basic ZIP decompression. A far better option is to use StuffIt Expander 5.5.1 on 68k Macs, but even that often isn't enough. But on PPC Macs, StuffIt Expander 7.0.3 will almost always do the job.

With this, I mean to highlight that AppleDouble ".zip" files created by Mac OS X have to be avoided at all costs, as it is inconvenient for any user of apps of the original Mac OS. Though most Garden contributors are already aware of that and just ".sit" everything anyway, thankfully.

Incidentally, the file I decoded was Diablo II's latest "Classic" patch, version 1.13d. Blizzard themselves stupidly distributed that patch that way, even though slightly earlier versions always were distributed with ".sit", while the "Carbon" (Mac OS X) versions with ".dmg".

In any case, what a fantastic little app Decode AppleFile is! It certainly deserves its own page here someday.

MikeTomTom's picture
Offline
Joined: 2009 Dec 7

In any case, what a fantastic little app Decode AppleFile is! It certainly deserves its own page here someday.

It has, now linked to, in the top post.

You might be interested in other Carl W. Bell creations - Especially those mentioned under the "Ancient" sub headings on that page. There may be some more gems there that could find their way here.

Jatoba's picture
Online
Joined: 2018 Apr 16

Thanks for creating the page, Mike. Smile One more piece of good software is now better-protected.

I also asked the author via e-mail just now if sharing the sources would be possible. It'd be interesting to try incorporating its functionality into a zip utility to handle Mac OS X's AppleDouble .zip files automatically. Though maybe he may not be able to share it.

MikeTomTom's picture
Offline
Joined: 2009 Dec 7

The AppleDouble code Carl Bell incorporated into Decode AppleFile, was "©1994 Christopher J. Newman." and credited in the readme doc and Bell's info page.

Tracking down Chris Newman's code may be the thing to find, if possible. Newman's copyright appears in full, in the accompanying readme with Decode Apple file and on the info page:

* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies.... etc, etc,...

Tracking it down may be difficult, given it's age.

MacZip already handles AppleDouble well. It just doesn't know the OS X "dot underscore" syntax, as it predates OS X zipped files. Writing that syntax into MacZip's code might be an easier mission.

MacZip's, Codewarrior Pro 5 source code is still available for all, from the author's site.

Jatoba's picture
Online
Joined: 2018 Apr 16

As far as I can see on the site/readme, Chris Newman's code was only for AppleSingle files (from the MPack app).

But yeah, working upon MacZip may be a better idea (I didn't know its source was already disclosed).

MikeTomTom's picture
Offline
Joined: 2009 Dec 7

3rd line, top of page, on info page (and Readme doc):
"AppleSingle/AppleDouble Code © 1994 Christopher J. Newman."

However, I need to revise my thinking on MacZip and AppleDouble. It looks like the MacZip code for zipping/unzipping Mac data/resource forks of it's own zip files is unique to MacZip and perhaps would not such an easy fix to get it to extract OS X zip files... Source code is there to examine tho...

I know of only one other program that can extract MacZip archives correctly, and that's the Pacifist, on OS X.

Jatoba's picture
Online
Joined: 2018 Apr 16

Oh, right, I totally didn't see that, thanks for pointing it out. I think I kept being sidetracked by the later line that states "The AppleSingle code is based on source code originally by Chris Newman at CMU (MPack)". And/or I need glasses.

And MacZip's code was indeed reported to only understand its own fork splitting, on top of it having troubles decompressing certain .zip files altogether that even StuffIt Expander can handle, like the case with the Diablo II file I mentioned, but as you pointed out, having MacZip's source publicly available is an advantage, and perhaps a place to start from, or look at.

I will try locating Chris' AppleDouble source...
Edit: Maybe this is it? It does seem to contain two C functions, one for encoding and another for decoding AppleSingle/AppleDouble files, although it's not like I took yet the time to inspect what the code is actually doing.

MikeTomTom's picture
Offline
Joined: 2009 Dec 7

As far as I know, MPack was AppleSingle, only. But I don't know for certain.

mrdav's picture
Offline
Joined: 2011 Dec 3

Hi MTT, you have inadvertantly added a " at the end of the link to the source code, so you "get page not found"

MikeTomTom's picture
Offline
Joined: 2009 Dec 7

So I did. Thanks mrdav, fixed now.