[Mono-dev] ZipArchiveEntry - issue with reopening entries

Joao Matos joao at tritao.eu
Wed Feb 24 14:54:20 UTC 2016


Hi, this has been fixed in master.

On Thu, Jan 28, 2016 at 10:29 AM, Numpsy <webby at beardmouse.org.uk> wrote:

> I've been trying to use the latest version of the Open XML SDK with Mono
> 4.3.3 (built off the master branch), and as described at
> https://github.com/OfficeDev/Open-XML-SDK/issues/74 I'm running into a
> problem that looks to be a Mono issue.
>
> I think it essentially reduces down to the situation that the code
>
>
> using (ZipArchive archive = new ZipArchive(input, ZipArchiveMode.Update))
>      {
>          ZipArchiveEntry selectorEntry = archive.GetEntry("readme.txt");
>          using (Stream temp = selectorEntry.Open())
>           {
>               Console.WriteLine("Open1");
>           }
>
>          using (Stream temp = selectorEntry.Open())
>           {
>                Console.WriteLine("Open2");
>           }
>      }
>
> Works on MS .NET4.5 but on Mono throws an exception on the second open,
> because it thinks the stream is already open although it has actually been
> closed.
>
> I'm wondering, should the
>
>  if (openStream != null && Archive.Mode == ZipArchiveMode.Update)
>                 throw new IOException("The entry is already currently open
> for writing.");
>
> In ZipArchiveEntry.Open() be a bit more clever, and do something like check
> if the stream has been disposed, even though it's non-null?
>
>
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/ZipArchiveEntry-issue-with-reopening-entries-tp4667333.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20160224/c36b92a3/attachment.html>


More information about the Mono-devel-list mailing list