Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#9 Cannot open with mdAdd

v1.0_(example)
closed
nobody
None
5
2014-01-26
2013-05-30
Chris
No

I can't seem to use mdAdd to add files to an existing zip. Here's the code:

QuaZip* zipFile = new QuaZip( entry[0] );
qDebug()<<"zip opening was"<<<zipFile->open( QuaZip::mdAdd )<<<zipFile->getZipError();
QuaZipFile zFile( zipFile );
zFile.open( QIODevice::WriteOnly, QuaZipNewInfo( moduleName+".xml", moduleName+".xml" ));
QFile file( filename_xml );
file.open( QIODevice::ReadOnly );
zFile.write( file.readAll() );
file.close();
zFile.close();
zipFile->close();

With QuaZip::mdCreate, it works flawlessly. I've gone through the examples in the test suite, and it looks like I am using mdAdd correctly. I'm using windows 7, 64 bit.

Discussion

  • So...

    Where is the example of a ZIP file that's not working?

    Where is the output of the code you posted?

    I can see here that something is not working as it should, but that's it. Since mdAdd passes the test by itself, it seems that there is something about your archive that QuaZIP doesn't like. Maybe it was created by some other software that has some features QuaZIP doesn't support, like zip64 extension?

     
  • Chris
    Chris
    2013-05-30


    So I recompiled everything and mdAdd works now.

    I attached a ZIP. I've implemented a method that just overwrites the old zip file with:
    JlCompress::compressDir, but even with the zip file created there it still fails to use mdAdd for subsequent compressions. The output from the debugs are:

    zip opening was false 0

    quazip.dll is compiled as a 64 bit dll, would that automatically cause the use of a zip64 extension?

     
    Last edit: Chris 2013-05-30
  • No, zip64 has nothing to do with 64 bit systems. It's an extension of ZIP format that QuaZIP doesn't support (yet). What's strange is that it doesn't work when you create a file using QuaZIP itself. I'll look into it.

    For some reason I don't see your attachment anywhere except notification e-mail from SF, but I can't download it from there, and it's nowhere to be found on this page. I really hate this new SF platform. Please attach it again, maybe it'll help.

     
    • status: open --> closed