Skip to content

feat: support split and multi-volume archives - #203

Merged
nextestudios merged 3 commits into
mainfrom
feature/65-multi-volume
Sep 27, 2026
Merged

nextestudios merged 3 commits into
mainfrom
feature/65-multi-volume

Conversation

@nextestudios

Copy link
Copy Markdown
Owner

Summary

  • New VolumeSet (Infrastructure.Archives) gathers the volumes of a split archive from any volume: .7z.001/.zip.001 (plain split), .partN.rar, .rar + .r00… (old RAR naming), .z01… + .zip (Info-ZIP/WinZip spanned).
  • Missing volumes are listed by name before anything is read: gaps in the numbering, plus the last volume when the format tells how many there are (7z: declared end of the header in the signature header; RAR4/RAR5: end-of-archive "more volumes" flag, read by RarTail walking only the block headers; ZIP: disk number in the EOCD of the .zip). A plain .zip.001 split has no such marker, so a missing tail volume is reported as MissingVolume from the engine failure. RAR entries still incomplete after listing are also refused. Never a "completed" result with a missing part.
  • SharpCompressEngine opens the set with the format's own multi-file reader (ZipArchive/SevenZipArchive/RarArchive.Open(IEnumerable<FileInfo>)); ArchiveService.Detect detects the format from the first volume (or the name when the first is missing, so the error lists it). Split TAR/TAR.GZ is refused (BclTarEngine).
  • SafeExtractor guarantees unchanged (same session/plan path); the Mark of the Web now comes from any volume that has one.
  • Batch extraction counts marked volumes of one set once; StemOf strips volume suffixes (jogo.part01.rar → jogo).
  • Fixtures: RAR5/RAR4 multi-volume sets from SharpCompress (MIT, same commit as the others), a 911-byte 7z split made with 7-Zip 25.01 and a spanned ZIP made with Info-ZIP (provenance in tests/Fixtures/README.md). docs/archive-support.md records the observed results.

Tests (CI)

  • VolumeTests.Split_archive_opens_from_any_volume_and_extracts_everything (7z, RAR5, RAR4, old RAR names, spanned ZIP, plain ZIP split).
  • VolumeTests.Missing_volume_is_reported_by_name_and_nothing_is_extracted (first 7z missing, last 7z/RAR5/RAR4 missing, .z01 or .zip missing, plain zip split tail).
  • VolumeTests.Split_tar_gz_is_refused_instead_of_extracting_only_the_first_part.
  • BatchExtractionJourneyTests.Marked_volumes_of_one_split_archive_are_extracted_once.

No new UI; no manual checks needed.

Closes #65

🤖 Generated with Claude Code

@nextestudios
nextestudios force-pushed the feature/65-multi-volume branch from 9304dcb to c35afa9 Compare September 27, 2026 22:40
nextestudios and others added 3 commits September 27, 2026 19:46
Open .7z.001, .zip.001, .partN.rar, .rar + .r00 and .z01 + .zip sets from
any volume. VolumeSet gathers the volumes next to the chosen one and lists
the missing ones: gaps in the numbering and, when the format says how many
there are, the last one (7z declared header offset, RAR end-of-archive
"more volumes" flag, ZIP end-of-central-directory disk number). With a
missing volume nothing is opened or extracted. Split TAR/TAR.GZ is refused.

Extraction still goes through SafeExtractor; the Mark of the Web comes
from any volume that has one. Marked volumes of one set count once in a
batch extraction.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SharpCompress 1.0.0 fails with EndOfStream on entries that cross volumes
of a spanned zip. Join the volumes and rewrite the central directory in
memory instead, so the single-file reader is used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nextestudios
nextestudios force-pushed the feature/65-multi-volume branch from 39a2a90 to c5bbffa Compare September 27, 2026 22:47
@nextestudios
nextestudios merged commit e6937c5 into main Sep 27, 2026
1 check passed
@nextestudios
nextestudios deleted the feature/65-multi-volume branch September 27, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support split and multi-volume archives

1 participant