My program uses minizip(zlib- version 1.2.3) to compress an xml file. When the xml file size is greater than 4 GB(in fact
the max value of int 32 – 4294967295) then I find that when I try to extract the compressed file it gave me an unexpected error 0x80004005 (able to extract via 7zip).
I believe the zipping did not work properly.
If I check the size of the xml file then the size =(total bytes in the file) -(max value of int32). Please see the screenshot.
Size of zip file which is what remains after reducing the 4 GB
Now coming to the way the file is being zipped I am using below minizip fnctions with these params. If any of you are aware what is going wrong in the minizip compresiion for large files could you please give me suggestions
int returnVal = zipOpenNewFileInZip4(reinterpret_cast(m_pzipFile),
fileName, NULL, NULL, 0, NULL, 0, NULL,
Z_DEFLATED, Z_DEFAULT_COMPRESSION, 0,
-MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
NULL, 0, m_uGeneralflag);//Z_DEFLATED-0,Z_DEFAULT_COMPRESSION=-1,MAX_WBITS=15,DEF_MEM_LEVEL=8,Z_DEFAULT_STRATEGY=0
zipWriteInFileInZip(reinterpret_cast(m_pzipFile)// pBuffer, actualBufferSize)===>m-pzipFile void*,pBuffer of type char* that is being written to compressed file, actualBufferSize –int value that is size of pBuffer
zipCloseFileInZip(reinterpret_cast(m_pzipFile))
Possible fixes or awreness of problem, how to solve
user26530257 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.