macoszip

What's inside the __MACOSX hidden folder in zip files created in Mac OS


I am a Windows user and my application accepts zip files.

I realized that when the user compresses files with the built in zip compressor in Mac OSX, it results in an extra folder titled "__MACOSX" created in the extracted zip.

I need to handle this folder(__MACOSX) in my application. I just want to know what is in the hidden __MACOSX directory. Is it empty or does it contain some files? And if it contains files, then how many files does it contain? If there are files, is the number of files fixed? What kind of files are there (empty/non-empty etc.)? Need full info.

It's simple to check in Mac OS but I don't have a Mac so I can't figure out what is there in this folder. I searched but couldn't find the answer.


Solution

  • I zipped a folder "Pack" containing the following:

    What's inside "__MACOSX":

    So it seems "__MACOSX" contains a replication of the folder structure being zipped, with hidden files starting with a dot, instead of the real files. However, not all files are there, so it might be difficult to predict how many files (in my test, the real file Sound.m4a don't have a .Sound.m4a equivalent.)

    Those "hidden" files are not empty, they are binary files holding metadata.

    Why don't you just ignore this "__MACOSX" folder, and delete it, instead of processing it?