[go-nuts] Re: Differences in archive/zip between 1.6.3 / 1.7

2016-08-18 Thread Hotei
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.


[go-nuts] Re: Differences in archive/zip between 1.6.3 / 1.7

2016-08-17 Thread Radek Simko
I saw that change when reading the Changelog and I thought it doesn't 
affect me,
as ZIP format doesn't necessarily involve compression:

https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

> 4.1.3 Data compression MAY be used to reduce the size of files
>   placed into a ZIP file, but is not required.

but I assume there are some default compressors defined somewhere.

Thanks for a quick response.

-- 
Radek

On Wednesday, August 17, 2016 at 1:49:05 PM UTC+1, James Bardin wrote:
>
> Hi Radek,
>
> There were a lot of performance improvements in the compress/flate 
> package. https://tip.golang.org/doc/go1.7#minor_library_changes
>

-- 
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.