mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-09 05:24:55 +00:00
[PR #1013] [CLOSED] Add XZ/Lzw compression detection and clear error messages for compressed TAR files #1434
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?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/1013
Author: @Copilot
Created: 11/11/2025
Status: ❌ Closed
Base:
master← Head:copilot/fix-tar-xz-file-reading-issue📝 Commits (3)
ea8fcb9Initial planc8ca687Add XZ/Lzw support to TarReader and detection for compressed TAR in TarArchivee55af11Add tests for compressed TAR detection and fix stream disposal📊 Changes
3 files changed (+215 additions, -2 deletions)
View changed files
📝
src/SharpCompress/Archives/Tar/TarArchive.cs(+146 -2)📝
src/SharpCompress/Readers/Tar/TarReader.cs(+26 -0)📝
tests/SharpCompress.Test/Tar/TarArchiveTests.cs(+43 -0)📄 Description
Opening tar.xz files with
TarArchive.Open()failed with "Failed to read TAR header" because the library tried to read compressed data directly without decompression.Changes
TarReader: Added XZ and Lzw compression detection
TarReader.Open()now detects and handles tar.xz and tar.Z files alongside existing GZip/BZip2/ZStandard/LZip supportTarArchive: Added compression detection with clear error messages
TarArchive.Open()now detects all compressed TAR formats and throwsInvalidFormatExceptionwith actionable guidanceTarReaderAPIUsage
For compressed TAR files, use
TarReader:Attempting
TarArchive.Open()on compressed files now produces:Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.