mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #750] Add fast ExtractToDirectoryAsync extension method on IArchive
#1207
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/750
State: closed
Merged: Yes
As mentioned in #728 (and I believe some other issues), the
IArchive.WriteToDirectory(...)extension method can be very slow for.7zfiles. This extension utilizedIArchive.ExtractAllEntries()andIReaderso is fast for .7z files.Being async has nothing to do with the performance, rather, it's because I use this extension method from an async method and need it to perform the long-running work asynchronously. Ideally
IArchive.ExtractAllEntries()andIReader.WriteEntryTo(Stream)would be async as well and then the whole Task.Run wouldn't be needed and then it would make more sense to be async.It currently doesn't support
ExtractionOptionsor reporting progress throughIArchive's events (although it does report progress through a callback). But, it works great as-is for my use case, which I suspect is pretty common, and I wanted to share.