Page 1 of 1

Unzipping large files

Posted: Tue Oct 22, 2019 9:59 pm
by todinaca
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

Re: Unzipping large files

Posted: Thu Oct 24, 2019 11:12 pm
by doublemax
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.

Re: Unzipping large files

Posted: Mon Oct 28, 2019 2:06 pm
by todinaca
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