-
Notifications
You must be signed in to change notification settings - Fork 97
I have an exception in SevenZipExtractor.BeginExtractArchive(string directory) when unpacking a stream #25
Comments
I'm unable to reproduce the error, but your code snippet also seems incomplete - if you're calling BeginExtractArchive you'll need to ensure it's finished before continuing. The error you're getting, as it states occurs because the stream returns false on either CanSeek or CanRead - both of which are needed to extract files from it. A common cause for these to be false is if the stream is already closed. I'd check if the file you're trying to use is available to you and that the FileStream is still open. |
7z.dll x86 version 9.22
ср, 26 сент. 2018 г., 17:35 Joel Ahlgren <notifications@github.com>:
… I'm unable to reproduce the error, but your code snippet also seems
incomplete - if you're calling BeginExtractArchive you'll need to ensure
it's finished before continuing.
The error you're getting, as it states occurs because the stream returns
false on either CanSeek or CanRead - both of which are needed to extract
files from it. A common cause for these to be false is if the stream is
already closed.
I'd check if the file you're trying to use is available to you and that
the FileStream is still open.
Also which version of 7z.dll are you using?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AXOMwSFinm3Dvo-st9vItC9YE3CEoxUEks5ue1iJgaJpZM4W59wF>
.
|
7z 9.22 is almost 7.5 years old, I'd try with 18.05 (which is the only one I'll attempt to support, until a newer version is released). I'd also suggest using something like this:
Unless you're actually handling the asynchronous part outside of your snippet. |
I have tried 7z 18.5 but still i have same error. Full code:
|
It looks like there's an actual problem with doing asynchronous extraction from a stream (it seems the archive is never extracted), I'll look into it in a while. In your case, is there a reason you're manually opening a FileStream instead of just passing the file to BeginExtractArchive? In your code above, change |
Thank you. Yes, We use SevenSharp as part archive utils for a lot of various operations in applications(not only files).
I think that it is point where there is a mistake. |
Same trouble below (attachment is MimePart, from MimeKit library) :
|
.net 4.5.2
The specified stream can not seek or read.
Имя параметра: stream
Server stack trace:
в SevenZip.SevenZipExtractor.ValidateStream(Stream stream) в C:\projects\SevenZipSharp\SevenZip\SevenZipExtractor.cs:строка 691
в SevenZip.SevenZipExtractor.Init(Stream stream) в C:\projects\SevenZipSharp\SevenZip\SevenZipExtractor.cs:строка 100
в SevenZip.SevenZipExtractor.RecreateInstanceIfNeeded() в C:\projects\SevenZipSharp\SevenZip\SevenZipExtractorAsynchronous.cs:строка 36
в SevenZip.SevenZipExtractor.DisposedCheck() в C:\projects\SevenZipSharp\SevenZip\SevenZipExtractor.cs:строка 352
в SevenZip.SevenZipExtractor.ExtractArchive(String directory) в C:\projects\SevenZipSharp\SevenZip\SevenZipExtractor.cs:строка 1270
The text was updated successfully, but these errors were encountered: