Closed hevav closed 3 months ago
What are the files (filenames at least)? Enabling SelectiveCompression
turns compression off for certain files.
What are the files (filenames at least)?
*.mca (minecraft chunk files).
Enabling
SelectiveCompression
turns compression off for certain files.
This issue is a bug report - all files are not compressed without SelectiveCompression
enabled.
I believe this happens because hdr.Method = z.Compression
is only set in "if z.SelectiveCompression {}" clause. I think adding
else {
hdr.Method = z.Compression
}
should help
Ah I see!
Would you like to submit a pull request and get credited for the commit?
See #419
Thanks for the patch!
What version of the package or command are you using?
https://github.com/mholt/archiver/commit/743ede3881bb34d43b9ca063232367cbc237daea
What are you trying to do?
I'm trying to make a zip archive with compression.
What steps did you take?
What did you expect to happen, and what actually happened instead?
Expected: the files should be compressed. Actual: the files are not compressed at all.
How do you think this should be fixed?
We should append the else-clause in zip.go (last 3 lines in the code snippet below):
Workaround
It works as expected when I enable SelectiveCompression: