34

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?

sealz
  • 2,334

5 Answers5

50

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.

sleske
  • 23,525
14

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.

user unknown
  • 1,872
6

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...

r0ca
  • 5,833
0

I recently had a project that dealt with tar files. The resulting file contains all of the files but they are not compressed. In my opion tar files are a excelant way to archive zip files.

wburke
  • 1
-2

.tar files are not compressed files. .tar files are for wrapping multiple files into one. .gz files can only zip one file. So to make a multiple-file .gz compressed file, you make a .tar file and turn that into a .gz file. But there are no merits to compressing a pre-compressed file. So it makes no sense to make (for example) a .tar.gz.gz or a .zip with only .zips in it.