Unzipping large files

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
todinaca
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Aug 31, 2018 5:18 pm

Unzipping large files

Post by todinaca » Tue Oct 22, 2019 9:59 pm

We are trying to unzip a large zip file, it contains an 8 gig file, and some smaller files. However, the unzip process stops after the large file, and keeps the large file open.

The zip file does unzip using winzip executable, so we do not think it is an issue with the zip file.

reading zip stream (entry TestOutputFile.txt <--- this is the Large file, but looking at the file, it was unzipped correctly): bad length
Can't read from inflate stream: invalid stored block lengths

Below is the code that does this - with some of the error processing not included

Code: Select all

wxZipEntry* pZIPEntry = NULL;
		wxZipInputStream theZIPStream (theFile);
		int nFiles (theZIPStream.GetTotalEntries());
		for (int i(0); i < nFiles; i++)
		{
			pZIPEntry = theZIPStream.GetNextEntry();
			wxString outputFileName (theJob.GetOutputDirectory());
	                outputFileName += "/";
			outputFileName += pZIPEntry->GetName();
                       if (theZIPStream.OpenEntry(*pZIPEntry) == false) 
                       {
                             do error procssing
                        }
                       if (theZIPStream.CanRead() == false)
			{
                             do error procssing
                        }
			wxFileOutputStream theOutputFile (outputFileName);
			if (theOutputFile.IsOk() == false)
			{
                             do error procssing
                        }
                        theZIPStream.Read (theOutputFile);
                  }
Thanks

Tom
Last edited by doublemax on Wed Oct 23, 2019 5:14 am, edited 1 time in total.
Reason: Added code tags

User avatar
doublemax
Moderator
Moderator
Posts: 14630
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Unzipping large files

Post by doublemax » Thu Oct 24, 2019 11:12 pm

Which platform and wxWidgets version are you using? I tested under Windows with the latest wx version from Github and it worked with a 8gb test file i created and compressed.

If it only happens with one particular archive, you'll probably have to make it available for download somewhere.
Use the source, Luke!

todinaca
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Aug 31, 2018 5:18 pm

Re: Unzipping large files

Post by todinaca » Mon Oct 28, 2019 2:06 pm

We did the same thing as you did, we upgraded to version 3.1.2 and the zip files now work. We wanted to stay on the newest stable release, but we will move to 3.1.2 to solve this issue.

We were using the last 'stable' release.

Thanks

Post Reply