SevenZipSharp icon indicating copy to clipboard operation
SevenZipSharp copied to clipboard

Solid archives

Open doug24 opened this issue 3 years ago • 0 comments

I started by asking why archives should be marked as Solid by default #161 Then I wondered by 7Zip wouldn't know how to extract a file from a Solid archive without going through the pain of asking 7Zip to extract every file in the archive preceding the file you want to extract (see the private static uint[] SolidIndexes(uint[] indexes) method)? Based on my tests and reading the 7Zip source code, there does not appear to be any reason to do that, you can simply extract a file from Solid archive the same way you can from a normal archive. This PR fixes:

  • Change the default setting for archives to not Solid, and only archives with the Solid property set are marked as Solid
  • Remove the SolidIndexes code, and extract files from Solid archive the same as normal archives
  • Remove the Solid archive exception from the ExtractFiles by callback method
  • Fix a bug in the ExtractFileCallbackArgs ExtractToStream setter
  • Add unit tests and unit test files for all changes
  • Make all the unit tests runnable from Visual Studio

I had hoped these changes would make a huge difference in extracting files from Solid archives, but they are still very slow.

In addition to the unit tests, I tested extensively on large archives. For my test archive I used the VS Code source 1.66 source drop, and made 7Zip, 7Zip solid, RAR and RAR solid archives from those archives.

doug24 avatar May 20 '22 01:05 doug24