If a .zip file contains all of the information of the original, just in less space, why does it have to be unzipped to access any of it?

820 views

If a .zip file contains all of the information of the original, just in less space, why does it have to be unzipped to access any of it?

In: 1276

43 Answers

Anonymous 0 Comments

Some great metaphors on here. I’ll try one, too.

Say we have two spies with codebooks. If a spy gets a message like “SPARROW,” they look up “SPARROW” in the codebook and it reads “Proceed with plan A immediatley.” Or maybe “SWAN” means “Abandon position, return to base by sea.”

If a spy gets an encoded message, he doesn’t know what it means until he looks it up in the codebook. The information’s there, but until he opens the book and looks up the code, he doesn’t know what to do.

ZIP files work the same way. The information’s all there, but you have to go through the process of decoding the information in order to know what it says.

Two special notes, though:

1. You don’t need to unzip the whole file. A program that understands zip files can totally reach in and decode one particular part of the zip file. A number of video games and such take advantage of this, unzipping little pieces or monster image files or whatever as needed.
2. This wasn’t part of your question, but zip files aren’t guaranteed to store thing in less space. There are some files which, when encoded, actually get bigger. That’s almost never the case in practice, but only because zip files are intentionally designed to be very effective on stuff like text documents. But if you filled a file with completely random bytes, zipping it would probably result in a slightly larger file.

You are viewing 1 out of 43 answers, click here to view all answers.