rikyoz / bit7z

A C++ static library offering a clean and simple interface to the 7-zip shared libraries.
https://rikyoz.github.io/bit7z
Mozilla Public License 2.0
623 stars 113 forks source link

Problems with extracting multi-volume #49

Closed chaseYLC closed 3 years ago

chaseYLC commented 3 years ago

bug

Fails to extract files created by applying mult-volume.

Env

Details

I set the volume size of 10mb

compressor.setVolumeSize(1024 * 1024 * 10);

Files smaller than the volume size were successfully extracted. ('myfile.001' file only ). However, extract fails when multiple files are created. ('myfiles.001 ... myfiles.021')

Extraction by programming fails, but Extraction succeeds when an external 7z program is used. So I think compression is not a problem.

The code where the failure occurs is this:

IInArchive* BitInputArchive::openArchiveStream( const BitArchiveHandler& handler,
                                                const wstring& name,
                                                IInStream* in_stream ) {

    ... 

    // Trying to open the file with the detected format
    HRESULT res = in_archive->Open( in_stream, nullptr, open_callback );

    ...    

}

res is S_FALSE !!
rikyoz commented 3 years ago

Hi! Strange, I don't seem to have any problem with the extraction of multi-volume archives. Just two questions:

Please note that even though you used a format like BitFormat::SevenZip for compressing the multi-volume archive, you need to use the BitFormat::Split format for extracting it!

chaseYLC commented 3 years ago

Thank you. It was caused by not using "BitFormat::Split". I didn't know I had to get 1 archive using "BitFormat::Split" .

rikyoz commented 3 years ago

No problem! Yeah, I definitely need to better document this detail! Thank you anyway for using bit7z!