Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zip-file that contains nothing but itself?

Just out of curiosity, does there exist a valid zip-file (according to format spec) that, contains nothing but itself?

Put another way, does the function implemented by unzip have a fix-point?

Can I write a program to search for such a fix-point in a intelligent (not-exhaustive) way?

I've thought about the opposite as well, i.e. if zip has a fix-point, but presumably a file can be compressed in different ways (different algorithms, different levels of compression and so on), thus whether or not f = zip(f) holds for some file f is probably implementation dependent. Since the zip-compression is loss-less however, the case for unzip should probably have a "formal" answer.

Has anyone explored this? Any pointers to related URLs are appreciated.

like image 286
aioobe Avatar asked Jul 02 '10 21:07

aioobe


People also ask

Can a zip file contain itself?

Like the line of shopping carts, it never ends, because it loops back onto itself: the zip file contains itself! And it's probably less work to put together a self-reproducing zip file than to put together all those shopping carts, at least if you're the kind of person who would read this blog.

Can a zip file be empty?

If you are getting a message that the zip file is empty when you try to extract the files, it probably means the file was corrupted during download. This can sometimes happen when you are using certain browser versions that handle file downloads differently from most other browsers.

What is a partial zip file?

zip. part file is an incomplete piece of a . zip file that has been only partially downloaded. You should either try to download the file again or search for the complete zip file and download that file.

What causes Zip file corruption?

There are various reasons for a zip file corruption. Incomplete download of a zip file from a website, viruses, file system errors, removable media corruption are some of the causes of zip corruption.


1 Answers

You can read about it here: http://research.swtch.com/2010/03/zip-files-all-way-down.html

Here you will find r.zip, which contains itself.

like image 61
Magnus Hoff Avatar answered Oct 02 '22 20:10

Magnus Hoff