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?

862 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

So many helpful answers, but I think the crux of the question is “to **access** any of it”.

In this subreddit, we can work with the abbreviated version of the name without ever needing to “unzip” it. I can type ELI5 and it just make sense, and that’s because you don’t need to access part of it. What’s the 5th character of this subreddit’s name? Can’t use ‘ELI5’ anymore; there isn’t even a 5th character in that. You gotta unzip it, but you also don’t have to unzip the whole thing either – just the E.

If I zip something down but then need to know (or modify) a piece which has been “abbreviated”, it automatically requires unzipping. For example, the number 17 quadrillion looks like 17000000000000000 which would often look like 1.7×10^16. I can always use that “zipped” format, it’s well understood, and the information is perfectly stored. But, if I want to add 17549 to that number, I suddenly have a problem – I can’t compress 17000000000017549 the same way **perfectly**. We could still compress it, like 170x10x17549. I could pass this number through a computer from program to program, but as soon as you – a human – wants to see what the number really looks like, we must “access” every part of it to be able to show each 0 in the middle. Now, we could show you 170x10x17549, and even allow you to do math with that format, but if anything were to “upset” the 10 zeros in the middle, we would need adjust our zipped version. So, generally, all “access” of a zipped item requires unzipping it.

Software which allows you to see inside of a compressed format is really just extracting the file (or parts of the file) into temporary location. This was how “[zip bombs](https://en.wikipedia.org/wiki/Zip_bomb)” would upset computers. You’d get a zip file that seems very small, but as you did something with it – like antivirus system scanning it – it might need to extract temporarily. Problem is, the zip bomb is dozens of levels deep, so it would temp-extract, find another zip, temp-extract that, find another zip, and keep doing that, never “closing” the parent. The tiny original zip will decompress to something so large a standard computer could not fit it. The most famous is *42.zip*, a 42 kilobyte file which fully decompressed would be 4.5 **petabytes**. Modern software can usually avoid this type of attack nowadays though.

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