Live data from Hacker News

How are zlib, gzip and zip related?

stackoverflow.com

61–70 of 81 posts

Re: How are zlib, gzip and zip related?

#61
If you are interested in implementation details, how to unpack/decompress them, check out these Python implementations:

- https://github.com/onekey-sec/unblob/blob/main/unblob/handle...

- https://github.com/onekey-sec/unblob/blob/main/unblob/handle...

- https://github.com/onekey-sec/unblob/blob/main/unblob/handle...

Re: How are zlib, gzip and zip related?

#62
post #43

Earlier quoted context omitted.

Maybe I should write the story as a comment on hacker news, and link to it ;) Joke aside, I should probably take up on your advice.

Yes. Do this (make sure it's not a top-level submission) and cite the HN comment specifically. Stupid rules deserve stupid compliance.

Why would a top-level submission not be valid on Wikipedia?

Re: How are zlib, gzip and zip related?

#65

Is there an archive format that supports appending diff's of an existing file, so that multiple versions of the same file are stored? PKZIP has a proprietary extension (supposedly), but I couldn't find any open version of that. (I was thinking of a creating a version control system whose .git directory equivalent is basically an archive file that can easily be emailed, etc.)

New versions of zstd allow you to produce patches using the trained dictionary feature

Re: How are zlib, gzip and zip related?

#66
post #55

Fun fact: in a sense. gzip can have multiple files, but not in a specially useful way ... $ echo meow >cat $ echo woof > dog $ gzip cat $ gzip dog $ cat cat.gz dog.gz >animals.gz $ gunzip animals.gz $ cat animals meow woof

Wow, that's surprising (at least to me)! Is there a limit in the default gunzip implementation? I'm aware of the concept of ZIP/tar bombs, but I wouldn't have expected gunzip to ever produce more than one output file, at least when invoked without options.

The limit is it doesn't do filenames or other metadata — it's limited to contents.

Re: How are zlib, gzip and zip related?

#67

Fun fact: in a sense. gzip can have multiple files, but not in a specially useful way ... $ echo meow >cat $ echo woof > dog $ gzip cat $ gzip dog $ cat cat.gz dog.gz >animals.gz $ gunzip animals.gz $ cat animals meow woof

WARC files (used by the Internet Archive to power the Wayback machine, among others) use this trick too to have a a compressed file format that is seek-able to individual HTTP request/response records

Re: How are zlib, gzip and zip related?

#68
post #42

Earlier quoted context omitted.

> ... but not in a specially useful way ... It can be very useful: https://github.com/google/crfs#introducing-stargz

It is specially useful, it is not especially/generally useful lol It could be a typo, though I think when we say something "isn't specially/specifically/particularly useful" we mean "compared to the set of all features, specifically this subset feature is not that useful" not that the feature isn't useful for specific things

Indeed! I should have written "especially" not "specially"

Re: How are zlib, gzip and zip related?

#69

Fun fact: in a sense. gzip can have multiple files, but not in a specially useful way ... $ echo meow >cat $ echo woof > dog $ gzip cat $ gzip dog $ cat cat.gz dog.gz >animals.gz $ gunzip animals.gz $ cat animals meow woof

Imo all file formats should be concatenable when possible. Thankfully ZStandard purposefully also supports this, which is a huge boon for combining files.

Fun fact, tar-files are also (semi-) concatenable, you'll just need to `-i` when decompressing. This also means compressed (using gz/zstd) tarfiles are also (semi-)concatenable!

Re: How are zlib, gzip and zip related?

#70
post #21

Earlier quoted context omitted.

I learned this when I tried correcting the wikipedia page on Docker. I literally wrote the first prototype. But this wasn't enough source for wikipedia. And to this day the English page is still not truthfull (interestingly enough, the french version is closer to the truth).

You could publish a little webpage called "An historical note about the Docker prototype" under your own name, which you could then cite on Wikipedia. I think it makes perfect sense as a general and strict policy for an encyclopedia. It would simply be too hard to audit every case to check if it's someone like you, or a crank.

That may fall afoul of the "reputably published" requirement at https://en.wikipedia.org/wiki/Wikipedia:No_original_research...

Basically, Wikipedia wants a primary source's claims to be vetted by a third party, either a "reputable publisher" or a secondary source.

Post reply on HN