[PR #1044] Unified progress reporting for compression and extraction operations #1474

Open
opened 2026-01-29 22:20:44 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/1044

State: closed
Merged: Yes


Unified progress reporting for compression and extraction operations

Adds unified progress reporting support using the IProgress<T> interface for both compression and extraction operations, similar to what 7-Zip's GUI provides.

Changes Made

New Progress Reporting API

  • ProgressReport class: Reports progress with EntryPath, BytesTransferred, TotalBytes, and PercentComplete properties
  • ProgressReportingStream: Internal stream wrapper that tracks read operations and reports progress
  • WriterOptions.Progress: IProgress<ProgressReport>? property for compression progress
  • ReaderOptions.Progress: IProgress<ProgressReport>? property for reader-based extraction progress
  • IArchiveEntry.WriteTo/WriteToAsync: Now accept optional IProgress<ProgressReport>? parameter for archive entry extraction progress

Removed Old Event-Based Progress Reporting

  • Removed IExtractionListener, IReaderExtractionListener, IArchiveExtractionListener interfaces
  • Removed ReaderProgress, ListeningStream, ArchiveExtractionEventArgs classes
  • Removed CompressedBytesReadEventArgs and FilePartExtractionBeginEventArgs
  • Removed old events from IArchive and IReader interfaces
  • Updated MultiVolumeReadOnlyStream, RarArchiveEntry, RarReader to remove listener dependencies

Merged from Master

  • Integrated new ZStandard compression implementation
  • Integrated TarHeaderWriteFormat option for TarWriter
  • All progress reporting tests pass (19 tests)
  • Code formatted with CSharpier

Fixes #1027

Original prompt

This section details on the original issue you should resolve

<issue_title>Feature Suggestion: Saving progress</issue_title>
<issue_description>I searched existing issues and only found something related to extraction progress.
It would be very helpful to have progress reporting during compression operations, similar to what 7-Zip's GUI provides.
Ideally, this could be implemented using the IProgress interface, which would make it easy for users to read progress updates.
If a way to read saving progress is already available can you please point out how can I hook into it?</issue_description>

Comments on the Issue (you are @copilot in this section)


Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

**Original Pull Request:** https://github.com/adamhathcock/sharpcompress/pull/1044 **State:** closed **Merged:** Yes --- ## Unified progress reporting for compression and extraction operations Adds unified progress reporting support using the `IProgress<T>` interface for both compression and extraction operations, similar to what 7-Zip's GUI provides. ### Changes Made #### New Progress Reporting API - **`ProgressReport` class**: Reports progress with `EntryPath`, `BytesTransferred`, `TotalBytes`, and `PercentComplete` properties - **`ProgressReportingStream`**: Internal stream wrapper that tracks read operations and reports progress - **`WriterOptions.Progress`**: `IProgress<ProgressReport>?` property for compression progress - **`ReaderOptions.Progress`**: `IProgress<ProgressReport>?` property for reader-based extraction progress - **`IArchiveEntry.WriteTo/WriteToAsync`**: Now accept optional `IProgress<ProgressReport>?` parameter for archive entry extraction progress #### Removed Old Event-Based Progress Reporting - Removed `IExtractionListener`, `IReaderExtractionListener`, `IArchiveExtractionListener` interfaces - Removed `ReaderProgress`, `ListeningStream`, `ArchiveExtractionEventArgs` classes - Removed `CompressedBytesReadEventArgs` and `FilePartExtractionBeginEventArgs` - Removed old events from `IArchive` and `IReader` interfaces - Updated `MultiVolumeReadOnlyStream`, `RarArchiveEntry`, `RarReader` to remove listener dependencies ### Merged from Master - ✅ Integrated new ZStandard compression implementation - ✅ Integrated TarHeaderWriteFormat option for TarWriter - ✅ All progress reporting tests pass (19 tests) - ✅ Code formatted with CSharpier Fixes #1027 <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Feature Suggestion: Saving progress</issue_title> > <issue_description>I searched existing issues and only found something related to extraction progress. > It would be very helpful to have progress reporting during compression operations, similar to what 7-Zip's GUI provides. > Ideally, this could be implemented using the IProgress<T> interface, which would make it easy for users to read progress updates. > If a way to read saving progress is already available can you please point out how can I hook into it?</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> - Fixes adamhathcock/sharpcompress#1027 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/adamhathcock/sharpcompress/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
claunia added the pull-request label 2026-01-29 22:20:44 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1474