:zip.unzip created unnecessary files

I have used :zip.unzip/2 to perform unzip operation, it is supposed to extract one file, however, __MACOSX is created for some reasons. Any idea about it?

iex> :zip.unzip('/tmp/archive.zip', [{:cwd, '/tmp/extracted/'}]) |> IO.inspect()
{:ok,
 ['/tmp/extracted/01.log',
  '/tmp/extracted/__MACOSX/._01.log']}

Have you checked by other tools if that __MACOSX folder does exist in the archive? It sounds like some special folder that might be hidden but still got zipped on the creating system without knowledge of the creator.

3 Likes