-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ZIP64 creation with individual files larger 4GB and new archive sample #730
Conversation
The archive sample fails to build (with |
abb3300
to
88c3a78
Compare
@MaartenBent thanks for testing, I've corrected the linked libs |
There are still some link errors, but a lot less. I think you need to use template="wx_sample_console" template_append="wx_append_base" like the ( |
88c3a78
to
9029e3f
Compare
Changed the bkl to use |
dbf6320
to
946fff0
Compare
Yes, now it works 👍. g++ -c -o gcc_mswu64\archive_archive.o -O2 -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -I.\..\..\lib\gcc_lib64\mswu -I.\..\..\include -W -Wall -I. -DwxUSE_GUI=0 -Wno-ctor-dtor-privacy -m64 -std=c++11 -MTgcc_mswu64\archive_archive.o -MFgcc_mswu64\archive_archive.o.d -MD -MP archive.cpp
archive.cpp:77:1: warning: missing initializer for member 'ArchiveApp::ArchiveCommandDesc::id' [-Wmissing-field-initializers]
};
^
archive.cpp:77:1: warning: missing initializer for member 'ArchiveApp::ArchiveCommandDesc::desc' [-Wmissing-field-initializers] Creating a zip with a 6gb file using the sample correctly enables zip64 and 7zip does not complain. When I use |
Specific values where not correctly converted because of a signed/unsigned mismatch.
If single files larger than 4GB where added the recorded file sizes in the local file header where not updated correctly. Additionally recorded file sizes in the central directory where in the wrong order making it impossible to extract. To enable adding files with unknown size which might be larger than 4GB the new method wxZipOutputStream::SetFormat() is added. Additionally a check has been added in case a file larger 4GB has been written without ZIP64 info.
This sample shows usage of wxArchiveStream and wxArchiveFactory. It also allows for easy testing of wxArchiveStream implementations outside of the unit tests.
946fff0
to
925ca59
Compare
@MaartenBent Regarding the info 7-zip shows: it uses version to extract from the central directory but other infos from local. But just to be sure I've changed the version in the central directory too. Which I think shouldn't matter much, but just seems right. |
I'm a bit afraid of adding a new sample, which might fail to compile in some untested build configuration, just before 3.1.1, but OTOH I definitely do want to fix ZIP64 support before it. So I'd rather merge the first 2 commits right now, but leave the sample until after 3.1.1, or do you think it's absolutely and totally safe to merge the commit adding the sample right now as well? |
I wouldn't expect any issues with the sample. but I think it's reasonable to postpone it to after 3.1.1 and just include the fixes just to be on the safe side. |
Thanks, I'm merging the first 2 commits with some minor fixes to the documentation (please review them if possible to check if I misunderstood anything) and will merge the commit adding the sample after 3.1.1. |
Notably fix ZIP64 creation with individual files larger than 4GB. See #730
Oops, thanks for noticing this, will fix (no idea how did it happen...). |
This sample shows usage of wxArchiveStream and wxArchiveFactory. It also allows for easy testing of wxArchiveStream implementations outside of the unit tests. See #730
I've added the commit adding the sample too now, so there should be nothing left here. Thanks again! |
If single files larger than 4GB where added the recorded file sizes
in the local file header where not updated correctly. Additionally
recorded file sizes in the central directory where in the wrong order
making it impossible to extract.
To enable adding files with unknown size which might be larger than 4GB
the new method wxZipOutputStream::SetFormat() is added.
Additionally a check has been added in case a file larger 4GB has been
written without ZIP64 info.
I've also created a new sample archive to show using wxArchiveStreams
Additionally potential issue when reading ZIP64 files is fixed.