Reputation: 13
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<zipFile>(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<zipFile>(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<zipFile>(m_pzipFile))
Possible fixes or awreness of problem, how to solve
Upvotes: 0
Views: 62
Reputation: 112502
You are using a 13-year old version of zlib. Get the current version from http://zlib.net/ or https://github.com/madler/zlib (the latter where you yourself had posted this same question!) and compile it. It has a zipOpenNewFileInZip4_64()
function.
Upvotes: 3