[PR #661] [MERGED] Added multipart Zip support (z01...). Added IEntry.IsSolid #1146

Open
opened 2026-01-29 22:19:12 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/661
Author: @Nanook
Created: 4/25/2022
Status: Merged
Merged: 4/29/2022
Merged by: @adamhathcock

Base: masterHead: master


📝 Commits (3)

  • 2246143 Added multipart Zip support (z01...). Added IEntry.IsSolid and implemented Rar and 7Zi[ support.
  • 71c8f31 RarStream Position fix, it was returning the file size. 7Zip CrcCheckStream always failed. Added a Solid Rar entry CRC test.
  • 910aa1c Corrected the Crc exception as it was within a #DEBUG define

📊 Changes

27 files changed (+305 additions, -52 deletions)

View changed files

📝 .gitignore (+1 -0)
📝 src/SharpCompress/Archives/AbstractWritableArchive.cs (+7 -1)
📝 src/SharpCompress/Archives/ArchiveFactory.cs (+17 -1)
📝 src/SharpCompress/Archives/Rar/RarArchiveEntry.cs (+1 -0)
📝 src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs (+14 -2)
📝 src/SharpCompress/Archives/Zip/ZipArchive.cs (+78 -17)
📝 src/SharpCompress/Common/Entry.cs (+1 -1)
📝 src/SharpCompress/Common/IEntry.cs (+1 -0)
📝 src/SharpCompress/Compressors/LZMA/Utilites/CrcCheckStream.cs (+12 -7)
📝 src/SharpCompress/Compressors/Rar/RarStream.cs (+7 -3)
📝 src/SharpCompress/IO/SplitStream.cs (+52 -16)
📝 tests/SharpCompress.Test/ArchiveTests.cs (+30 -1)
📝 tests/SharpCompress.Test/Rar/RarArchiveTests.cs (+39 -1)
📝 tests/SharpCompress.Test/SevenZip/SevenZipArchiveTests.cs (+11 -1)
📝 tests/SharpCompress.Test/Zip/ZipArchiveTests.cs (+34 -1)
tests/TestArchives/Archives/7Zip.nonsolid.7z (+0 -0)
tests/TestArchives/Archives/7Zip.solid.7z (+0 -0)
tests/TestArchives/Archives/DotNetZip-obhg3mhx.tmp (+0 -0)
tests/TestArchives/Archives/Infozip.nocomp.multi.z01 (+0 -0)
tests/TestArchives/Archives/Infozip.nocomp.multi.zip (+0 -0)

...and 7 more files

📄 Description

Multi Volume Zip support for zip and zipx
Unit tests added for multipart archives created with WinZip and InfoZip. They are uncompressed due to the minimum part size being 65k.

The implementation is a little bit clunky. It requires the parts to be passed in in the order zip,z01 / zipx,zx01 ..., the zip is actually the last part of the archive. Once the central directory has been located and the archive is being opened the zip is switched to the end of the volumes for processing. Is seems more logical the user would select the zip/zipx not the z01/zx01. Feel free to reimplement this as your knowledge of zip is better than mine ;-)

IEntry.IsSolid for rar and 7zip
It's useful to know which files in an archive can be seeked and extracted. The Rar format sets the first file to solid=false and subsequent files in a solid set to solid=true. This allows solid-false files to be opened with seek. The 7zip implementation follows this behaviour. IsSolid already existed for Rar Entries, but it was never populated when using Archive.Open.

Cheers ;-)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/661 **Author:** [@Nanook](https://github.com/Nanook) **Created:** 4/25/2022 **Status:** ✅ Merged **Merged:** 4/29/2022 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (3) - [`2246143`](https://github.com/adamhathcock/sharpcompress/commit/224614312fa7992e98f4cab9136c2723892ca103) Added multipart Zip support (z01...). Added IEntry.IsSolid and implemented Rar and 7Zi[ support. - [`71c8f31`](https://github.com/adamhathcock/sharpcompress/commit/71c8f3129f7443b6bb4eaef865bb7e2beb2844ea) RarStream Position fix, it was returning the file size. 7Zip CrcCheckStream always failed. Added a Solid Rar entry CRC test. - [`910aa1c`](https://github.com/adamhathcock/sharpcompress/commit/910aa1c22ed65a95311aa0c28a4249ad54266294) Corrected the Crc exception as it was within a #DEBUG define ### 📊 Changes **27 files changed** (+305 additions, -52 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -0) 📝 `src/SharpCompress/Archives/AbstractWritableArchive.cs` (+7 -1) 📝 `src/SharpCompress/Archives/ArchiveFactory.cs` (+17 -1) 📝 `src/SharpCompress/Archives/Rar/RarArchiveEntry.cs` (+1 -0) 📝 `src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs` (+14 -2) 📝 `src/SharpCompress/Archives/Zip/ZipArchive.cs` (+78 -17) 📝 `src/SharpCompress/Common/Entry.cs` (+1 -1) 📝 `src/SharpCompress/Common/IEntry.cs` (+1 -0) 📝 `src/SharpCompress/Compressors/LZMA/Utilites/CrcCheckStream.cs` (+12 -7) 📝 `src/SharpCompress/Compressors/Rar/RarStream.cs` (+7 -3) 📝 `src/SharpCompress/IO/SplitStream.cs` (+52 -16) 📝 `tests/SharpCompress.Test/ArchiveTests.cs` (+30 -1) 📝 `tests/SharpCompress.Test/Rar/RarArchiveTests.cs` (+39 -1) 📝 `tests/SharpCompress.Test/SevenZip/SevenZipArchiveTests.cs` (+11 -1) 📝 `tests/SharpCompress.Test/Zip/ZipArchiveTests.cs` (+34 -1) ➕ `tests/TestArchives/Archives/7Zip.nonsolid.7z` (+0 -0) ➕ `tests/TestArchives/Archives/7Zip.solid.7z` (+0 -0) ➕ `tests/TestArchives/Archives/DotNetZip-obhg3mhx.tmp` (+0 -0) ➕ `tests/TestArchives/Archives/Infozip.nocomp.multi.z01` (+0 -0) ➕ `tests/TestArchives/Archives/Infozip.nocomp.multi.zip` (+0 -0) _...and 7 more files_ </details> ### 📄 Description **Multi Volume Zip support for zip and zipx** Unit tests added for multipart archives created with WinZip and InfoZip. They are uncompressed due to the minimum part size being 65k. The implementation is a little bit clunky. It requires the parts to be passed in in the order zip,z01 / zipx,zx01 ..., the zip is actually the last part of the archive. Once the central directory has been located and the archive is being opened the zip is switched to the end of the volumes for processing. Is seems more logical the user would select the zip/zipx not the z01/zx01. Feel free to reimplement this as your knowledge of zip is better than mine ;-) **IEntry.IsSolid for rar and 7zip** It's useful to know which files in an archive can be seeked and extracted. The Rar format sets the first file to solid=false and subsequent files in a solid set to solid=true. This allows solid-false files to be opened with seek. The 7zip implementation follows this behaviour. IsSolid already existed for Rar Entries, but it was never populated when using Archive.Open. Cheers ;-) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:19:12 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1146