Re: Any zip or tgz that decompress to itself ?



Hans-Peter Diettrich wrote:
Olivier Girant wrote:

I don't agree with you. The zip header format is not compressed and is not random data at all. One can take advantage of the potentially compressible header to have a zip file with the same size. It implies that the "incompressible" part size is not too high. I think that the difficulty is not to file size, but make the file respects the zip format with header and file list...

Quite a new approach: add data to an already compressed file, to make it compress better? Not impossible, but also not very probable.

DoDi

I do not intend to add data to "compress better"... I imagine the zip archive content like this:
- header for compressed file1
- compressed file1
- central directory for file1
- digital signature

The header and the central directory are very redundant, you can see some run of 0 and several fields are the same. Moreover you can play with archive comment to add even more redundancy, so as to make the global archive size equal to the uncompressed file size.

I don't bother if the zip file (and the compressed file inside) is very big, several MB. I just want the filename inside to be .zip and the compressed file to be expanded to the same content as the zip archive.

Are the explanation clearer ?

Olivier
.



Relevant Pages

  • Re: Reading compressed files
    ... (especially unix compress). ... HEADER BODY and FOOTER by open function. ... What you need to do is research each syntax and ...
    (comp.lang.python)
  • Re: Converting Compressed RISCOS ROM Images to Readable Format
    ... are supplied in compressed form into normal readable format. ... appear compressed with header word "SQSH". ... to "Squash" and unsquashing them gives the error "Invalid Squash ... ancient UNIX tool 'compress', which is 20 bit LZW, except for the ...
    (comp.sys.acorn.apps)
  • Re: http/1.1 decompress
    ... I should be able to remove the content-encoding field from the header ... the request is send to the server => the server won't compress the ... so just make sure you don't set the header in your code explicitly. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Any zip or tgz that decompress to itself ?
    ... possible to create a zip or tgz file: ... Since compressed files do not compress very well, I'd assume that a zipped zip will become longer, due to the added header etc. information. ... Most compressors refuse to compress an uncompressable file again, and instead switch to store mode, what obviously must result in a bigger output file. ... The zip header format is not compressed and is not random data at all. ...
    (comp.compression)
  • Re: Any zip or tgz that decompress to itself ?
    ... possible to create a zip or tgz file: ... Since compressed files do not compress very well, I'd assume that a zipped zip will become longer, due to the added header etc. information. ... Most compressors refuse to compress an uncompressable file again, and instead switch to store mode, what obviously must result in a bigger output file. ... The zip header format is compressed and is not random data at all. ...
    (comp.compression)