Avatar of Mike Broderick
Mike Broderick
Flag for United States of America asked on

Problems with deflate routine in a create-zip-file program

I have a program that creates a zip file. It is starting to work, but when I try to compress the data using deflate, I get an error when trying to access any of the zipped files using PKZip for Windows or the Windows 10 file explorer (there is no additional info). I can open the file and traverse through the directory tree, but when I try to extract a file or display its contents, I get an error. For example "Unknown compression method for file C:\xxxxx. My deflate routine is the same one I have used in a create PDF program, it has been working for years. I tried altering the flate routine to build a gzip wrapper, and then no wrapper (for PDF the routine creates a zlib wrapper). None worked.

Is there a variant of the deflate routine that is different from PDF applications that I need to use to create zip files?

Does anybody know of a "zip-file-tester" app? The the unzip apps I am using basically say "you have an error" and nothing else. (or, is there a verbose option to get more detailed error messages?)

Thank you 
* zlib* zipped filesWindows 7

Avatar of undefined
Last Comment

8/22/2022 - Mon

Try a more tested method, using the 7zip commandline.
If you wanna program it yourself, use the DLLs instead. Heck, there's even pure source code if you want to build it from the bottom up.
More reliable, more compression too.

As for the tester, 7zip can do a archive test. However, it won't help you one bit, as you've proven that any zip action didn't work, so something's fundamentally wrong. Any clear error that will be returned or not, won't change the fact that the zipping has gone awry anyway. That's besides the fact that the reason will never be known, as the zip file is just a zip file, it doesn't contain anything like a log or something to tell you more things, other than that it's corrupt.
Just start over with 7zip/LZMA.
Mike Broderick

Sorry I didnt mention that this runs on an IBM iSeries (what's a DLL lol). It took months to get the flate modules to work on the iSeries and it is not worth the time to attempt to convert another method. 

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck