This project is read-only.


ZipErrorAction.Skip is not honored when using nonseekable output stream, and File.Open fails


Suppose ZipFile.ZipErrorAction is set to InvokeHandler, When DotNetZip encounters an error opening a file, it invokes the error handler. Suppose that it tells DotNetZIp to skip that entry. In the general case, DotNetZIp needs to seek back in the output stream, to "erase" any output that has already been emitted for that entry. If the output stream is non-seekable, this Seek would fail, therefore DotNetZip throws.
However, there is a special case, in which the File.Open fails due to a sharing violation, for example. In that case there is no need to seek backward in the output stream, because no output was sent to the output stream at all.
DotNetZip should not try to seek back unless necessary.
With that change, DotNetZip will skip the entry if it fails to open, and not try to seek back in the output stream.
I hope this is clear; ask if not.
Closed Jul 11, 2011 at 12:35 PM by Cheeso
fixed in changeset 80525. The first binary with this change will be v1.9.1.6.


BrianTacker wrote Jul 11, 2011 at 10:21 PM

I just want to let you know I tested it with my code and its working well. Thank you

wrote Feb 22, 2013 at 2:43 AM

wrote May 16, 2013 at 1:31 PM