Can Double Zipping Cause Problems?

I have a directory that I have been storing a ton of files in. Among the 10ish types of files there are also .zips of other directories.

In my personal experience I vaguely remember issues when trying to zip zips (ha zip zips).

Will compressing an already compressed file cause immediate problems, or potentially problems later on when I attempt to uncompress it?

I read Can zipping a file break it?, but it does not really address the zipping of zips. I did notice that corruption can cause zips to break. Would zipping zips potentially corrupt files?


Solution 1:

Zipping zips is fine. If there is a problem, that would be a bug in the compression software :).

You will probably not get any further compression for those files though unless you're using a higher level of compression.

Solution 2:

Zipping a zip might confuse AV software. There are zips, which contain themselves as a new zip of themselves, which leads to an endless recursion if your AV software tries to inspect a zip in a zip, and to avoid such an recursion, the AV software might make a false alarm.

Tools which search in zips like zgrep will not inspect zips in zips. But if you are aware of it, this might not be such a problem.

The compression result can suffer. Think of 2 zipfiles:

a.zip
- a.txt 
- b.txt 

b.zip
- b.txt

a.zip and b.zip can be very different and hard to compress further. If zipping

combined.zip
-a/a.txt
-a/b.txt
-b/b.txt

both b.txt-files can be compressed very good.

So deflating internal zips before compressing the whole thing might lead to smaller results, but more importantly, it leads to better usable results.

Solution 3:

You can do that, you shouldn't see any problem but compressing a compressed folder, you won't gain a lot of compression. That's it...