Hi,
sorry for disturbing you, but I seem to be unable to find out what would be the best way to replace an existing file within a ZIP archive, withouth the overhead of extracting all files, replacing the target and packing them all again back into the archive.
Opening the archive with QuaZip::mdCreate will write my target file to the archive while at the same time deleting all other files, while writing my file to the archive opened with QuaZip::mdAdd while specifying the target file name (see code snippet below) will get me an archive containing the target file twice with the same name (the original one and the new one), which is definitively also not the desired output...
container.open( QuaZip::mdAdd ) QuaZipFile* pCurrent = new QuaZipFile(&container); pCurrent->open( QIODevice::WriteOnly, QuaZipNewInfo( sExistingFileName ) );
Thanks in advance for your assistance,
NWeyand
Hi,
Sorry for the late reply. It's impossible with the current version of QuaZIP, and I don't think it will be any time soon. That would be a very tricky thing to do, and anyway it will involve the overhead of moving all files after the replaced/deleted one, much like you need to move data around when deleting from a contiguous vector.