Closed
Conversation
Implements support for extracting multi-volume RAR archives (split archives with .rar, .r00, .r01, etc. naming convention). Changes: - Add custom multivolume stream handler (stream-multivolume.c) that seamlessly reads across multiple physical volume files - Implement rar_continue_volume() to parse headers at volume boundaries and correctly track data segments across volumes - Modify rar_copy_stored() and br_fill() to handle volume transitions during extraction - Add OpenMultivolume() function in Go wrapper to detect and open RAR archives using the multivolume stream - Add TestMultiVolumeRar() test that validates extraction from any multi-volume RAR in testdata/multivolume/ directory - Update README with feature documentation and testing instructions The implementation correctly handles: - Reading data that spans multiple volume files - Parsing RAR headers at volume boundaries (signature, main header, file entry headers) - Extracting both stored and compressed files from multi-volume archives - Gracefully falling back to single-file streams when needed All existing tests pass, and multi-volume extraction is verified to produce correct output matching reference files.
Enhanced volume naming to support archives spanning hundreds of files: - .rar (first volume) - .r00-.r99 (volumes 0-99) - .s00-.s99 (volumes 100-199) - .t00-.t99 (volumes 200-299) - continuing through alphabet to .z99 (up to 2600 total volumes) Updated documentation and comments to reflect extended support.
Corrected the maximum volume limit from 2599 to 899 (.z99) as the alphabet only spans r-z (9 letters × 100 volumes each). Changes: - Fixed volume naming to properly support .r00-.r99, .s00-.s99, through .z00-.z99 - Updated safety limit from 2599 to 899 in multivolume_seek - Added comprehensive unit tests for volume path naming - Added test helper function TestGetVolumePath for testing volume naming logic - Tests cover all edge cases, boundaries, and alphabet coverage - All 26 tests pass successfully This ensures archives can span up to 900 volumes correctly.
Owner
|
Nice, thanks! I need to find a time to test it. And I would prefer if AI did not mess with the README, i.e., |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds comprehensive support for extracting multi-volume RAR archives (split archives with
.rar,.r00,.r01, etc. naming convention).Key Changes
stream-multivolume.c) that seamlessly reads across multiple physical volume filesrar_continue_volume()to parse RAR headers at volume boundaries and correctly track data segments across volumesrar_copy_stored()andbr_fill()to handle volume transitions during extraction of both stored and compressed filesOpenMultivolume()function in the Go wrapper to detect and open multi-volume RAR archives.rar(first volume).r00-.r99(volumes 0-99).s00-.s99(volumes 100-199).t00-.t99(volumes 200-299).z00-.z99(volumes 800-899)Testing
TestMultiVolumeRar()integration test that validates extraction from multi-volume RAR archivesTestGetVolumePathfor testing volume namingDocumentation
Test plan
go test -vto verify all existing tests pass