Repository navigation
feat: create 7z archives with the managed LZMA encoder - #214
Merged
Merged
Conversation
SharpCompress can't write 7z, but it ships the LZMA SDK encoder (public domain port). SevenZipWriter writes a solid LZMA 7z container following 7zFormat.txt: signature header, packed stream and a plain header with sizes, per-file CRC-32, UTF-16 names, times, attributes and empty files/folders. No new dependency or native binary (decision 0008). The compress dialog cycles ZIP -> TAR.GZ -> 7z; the creator keeps its rules (links not followed, temp file, never overwrite). Co-Authored-By: Claude Opus 5.5 <[email protected]>
SharpCompress 1.0.0 reports entries without a data folder as encrypted, so any 7z with an empty file asked for a password. Co-Authored-By: Claude Opus 5.5 <[email protected]>
nextestudios
force-pushed
the
feature/67-7z-creation
branch
from
September 27, 2026 22:57
195863e to
16c3def
Compare
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.
Summary
SevenZipWriterwrites the 7z container from the SDK's7zFormat.txt: signature header, one solid LZMA stream, plain header with sizes, per-file CRC-32, UTF-16 names, mtime, attributes, empty files and empty folders. Alternatives evaluated: bundling7za.exe(LGPL, ~1 MB per arch, external process, unsigned third-party binary) and7z.dllwrappers (LGPL, native P/Invoke, unmaintained wrappers).IArchiveService.CompressAsync; same safety rules as the other writers (links/junctions not followed, temp file renamed at the end, never overwrite, cancel leaves nothing).Tests (CI)
ArchiveCreatorTests.Round_trip_create_then_extractgains the 7z case;SevenZip_keeps_empty_files_and_folders_and_compresses(fast/max).SevenZipInteropTests(Windows integration): the runner's real 7-Zip runs7z tand7z xon the created archive at each level and every file matches byte for byte (fails on CI if 7-Zip is missing).UI: only the dialog text/option label; no manual checks needed beyond the existing compress flow.
Closes #67
🤖 Generated with Claude Code