Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
2  
Ouch my feelings are shattered due to a downvote –  sealz Mar 8 '12 at 18:25

4 Answers 4

up vote 32 down vote accepted

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.

share|improve this answer
2  
Well, there are different levels of compression. If you've just used the "package" method on the zips in the folder you're zipping, which doesn't compress anything, you may get compression on the files. If you used maximal compression on the zips to be zipped you probably won't get any more compression. Then again, if the maximally zipped zips you're zipping share compressable content with other files in the folder getting zipped, you'll get compression. So that "obviously" bit probably isn't exactly accurate. Everything else is though. –  music2myear Mar 8 '12 at 18:16
6  
the zip format compresses each file individually, so zipping a zip file actually can save some space; particularly the metadata is effectively uncompressed, and will be compressed in the zipped-zip. Probably the very best compression possible is by using no compression to collect the individual files into a single archive and then using maximum compression to reduce the single-archive size. This is basically the same idea with the .tar.gz format. –  TokenMacGuy Mar 8 '12 at 21:24
1  
Zipping a zip can gain you more space even if the compression is the same. –  m4tt1mus Mar 9 '12 at 1:02

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

share|improve this answer

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.

share|improve this answer
1  
+1 for mentioning additional possible problems, apart from data corruption –  sleske Mar 9 '12 at 8:17

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.