mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-09 21:24:08 +00:00
[PR #997] Fix ArchiveFactory.Open double-wrapping causing "Cannot determine compressed stream type" on Linux #1418
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/997
State: closed
Merged: Yes
ArchiveFactory.Open(stream)fails on Linux with "Cannot determine compressed stream type" when the stream is already wrapped or when buffering state needs careful management.Root Cause
ArchiveFactory.Openunconditionally creates a newSharpCompressStreamwrapper:This causes double-wrapping when the stream is already a
SharpCompressStream, leading to inconsistent buffering state that manifests differently across platforms.Changes
ArchiveFactory.cs: Use
SharpCompressStream.Createinstead of constructorTests: Added coverage for both pre-wrapped and raw FileStream scenarios
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.