Because zip compression programs can use different levels of compression there is certainly no expectation that zipping the same file with different compression levels will give the the same output. It MIGHT - but it's not to be expected or relied upon. The only thing that's "guaranteed" is that unzipping the zipped file (regardless of compression level) will return you to the original file. If it doesn't then it's obviously a bug. Confusion can happen because not all zip programs allow varying the compression level - especially the GUI versions and of course different programs can have different defaults. Look at the man page for zip and the -Z option or go to the PKware spec for details.
On Wednesday, August 17, 2016 at 8:40:08 AM UTC-4, Radek Simko wrote: > > Hi, > I read through the 1.7 changelog but didn't spot any change that would > explain this behaviour. > > Basically given a specific slice of bytes archived via "archive/zip" + > written to a file produces different file when doing so w/ Go 1.6.3 and > 1.7.0. > > See full repro case: > https://gist.github.com/radeksimko/62aa4b89af6633f7421e45c979523135 > The first example produces different ZIP file, second produces the same > one. > > Is anyone able to explain to me the difference I observed? > > I am aware that reproducible ZIP archives are tricky in general due to > timestamp-based metadata, > but I don't believe these affect me in the attached example. > > Thanks, > -- > Radek > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.