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?)
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.