What is the __MACOSX folder?

Occasionally you receive a compressed Zip file in which beside the actual folder also a folder with two prefixed underscores named “__MACOSX” is contained.

Of course, you wonder what this __MACOSX folder is all about and what it is supposed to be good for?

Screenshot look into the zip-file
look into the zip-file

Contents of the folder

If you look into the MACOSX folder, you will find exactly the same directories and files as in the actual zip file. However, the files differ slightly in the file name. The original file name is preceded by a dot and underscore in the form:

._FileName.ext

Screenshot Windows Explorer with content of __MACOSX directory
Compare Content of __MACOSX-Folder with original files

If you double-click on the files to open them, you get a message that the file cannot be opened with the linked default program. Opening it in a text editor shows only hex-code, so you can assume that it is a special binary file.

This notation also suggests that they are actually hidden system files that have a specific use, but should not actually be visible to the user.

Memory size of the MACOSX directory

If you look at the size of the files in the __MACOSX directory, you will see that the files are relatively small compared to the original files. In my case the files are only a few 100Byte. Here in Windows Explorer rounded up to 1kB.

Screenshot Property Window with file sizes
Properties and file size

Origin of the __MACOSX folder

If you take a closer look at the folder name, you can already guess. This folder is created when users of a MacBook with the corresponding operating system MacOS create the Zip file. The Zip file must have been created with the Zip compressor built into the operating system. This function has been supported by the Apple operating system since OS X 10.3. The Apple user simply creates the ZIP file by Right-Clicking and clicking on “Compress file“.

On a MacBook, this folder and the associated files are not displayed to the user. But if you open a file zipped under Mac OS X under the Windows operating system, Windows cannot do anything with it and displays the folder __MACOSX like a normal folder.

Use of the __MACOSX directory

This directory or the associated files contain compression functions specific to the operating system.

These are so-called Resource Forks. Such files are used to store some metadata to the original data. What this is exactly is difficult to say for the specific case. You would have to look at the files with a suitable editor, like Resorcerer. It can be information like the last window size or window position. However, resources such as file icons or fonts can also be included there.

Problems with __MACOSX folder can occur

In principle, this folder does not cause any problems, even if you open the ZIP file under Windows and Linux. As mentioned above, the MACOSX folder is displayed under these operating systems, but otherwise the files are ignored.

However, problems and error messages can occur if the ZIP package is used as an installation file. This can happen if, for example, a WordPress plugin is packed into a ZIP file and then uploaded within WordPress.

To avoid problems with the __MACOSX folder, you have to make sure that it is not created in the first place. This is best done with another third-party zip program, such as iZip.

You can also delete the __MACOSX folder, which is easy on Windows because it is visible. Under MacOS you can use the terminal by entering the following command:

zip -d myarchiv.zip "__MACOSX*"

One comment

  1. That was really helpful! I was wondering what the easiest way to delete all these hidden files was!

Leave a Reply

Your email address will not be published. Required fields are marked *