What is MACOSX folder in windows

More and more people are using Mac’s for development these days. As an example, a lot of the core developers from some of the leadingweb frameworks use Mac as their primary development platform. Several plugin and theme authors for WordPress also develop on Mac. While this is a good thing, there is one particular side effect of this development that annoys me beyond relief.

It seems that the easiest way to archive something on Mac is to right click on your directory of choice in Finder and select “Archive as…”. This creates a Zip file, which then the developer can distribute to users. The problem is that Apple, like many other software giants, tends to twist and bend the user’s will and interpret what the user wants to mean something else. In this case, the natural thing for the OS to do is pack up that directory, and ONLY that directory in a Zip file. But no sir, how can that be? How can Apple “transparently” embed some metadata in the Zip file so that if some other Mac user opens it in Finder, he/she can benefit from this metadata.

Apple does this by creating another folder suspiciously named ”%%__MACOSX%%” at the root of your Zip archive. Here’s an example (its the Cutline theme):

This folder contains, among other things, thumbnails for images in the original archive. Now, this kind of unwanted, undesirable outcomes just really really annoy me. But I’ll try to keep my cool, and present a systematic analysis of not only why what Mac OSX does is wrong, but also stupid and unnecessary:

  • No surprises: As a user, I don’t like surprises, specially of the bad kind. If I request to archive a directory into a Zip file, thats exactly what I want. If I later unarchive that zip file, I should get my original directory back. Nothing more, nothing less. Any kind of unintended behavior is BAD.
  • We are not stupid: If I wanted you to stick in an extra folder named ”%%__MACOSX%%” in my archive, I’d let you know. Your users are a smart group, don’t insult them like this.
  • I hate clutter: In my WordPress themes directory, I unzip Cutline. If each theme starts creating its own ”%%__MACOSX%%” folder, then my themes directory would soon get cluttered with needless garbage.
  • It breaks things: If MacOSX did something harmless, like embed some metadata (like Zip file creator) into the Zip file itself, I might have been OK. But creating an entire tree structure in the archive just breaks things, in ways more than one. As an example, if like Cutline, each WordPress theme started creating ”%%__MACOSX%%” folders in the root of the archive, then later if I install another theme, I’ll get lots of errors and file name collissions because the new theme will also try to extract in the ”%%__MACOSX%%” folder. Not only this, some programs (like Gallery and WordPress) have the ability to load plugins/images directly from Zip files. As a result, I’ll end up with unwanted images, themes and plugins in my setup. Not only this, it might actually just break your installation. Since you did not create the ”%%__MACOSX%%” folder yourself, you don’t know what is in it, and it might not always obey the expecations of the software.
  • Security: Again, you did not explicitly create that folder. What if someone creates a virus, that just modifies the default zip program on Mac to sneak in malicious payload via the ”%%__MACOSX%%” folders in any new Zip archives you create? Apart from the security risk, its a time sink. Why should I go around cleaning up mess that I did not create? Software is supposed to make my life easier, not harder.
  • Redundant: From the looks of it, it seems that all of the data inside the ”%%__MACOSX%%” folder is created from the original directory. No external information is used/needed. If thats the case, why oh why would anyone EVER need this stupid new folder? If some metadata is needed, it can always be reconstructed from the original on demand. This seems downright stupid to me.

Would someone, anyone, please explain Apple’s intent and motivation behind this “feature”? What are the benefits (if any)?

Written byDiwaker GuptaPosted inSoftware, TechnologyTagged withapple, mac, rants, zip