[Mono-dev] Understanding ZipSharp and Native(Un)Zip - any MonoPosixHelper gurus?

Maury Markowitz maury.markowitz at gmail.com
Thu Oct 30 14:05:50 UTC 2014


I'm hoping someone familiar with MonoPosixHelper and/or WindowsBase will see this.

I am attempting to port System.IO.Package to iOS. I have made some progress, to the point where my somewhat stripped-down WindowsBase is compiling under Xamarin on the Mac, and I can run the Packaging functions to the point of decompressing the file.

Following through the code, this appears to ultimately fail on this:

       [DllImport ("MonoPosixHelper", CallingConvention=CallingConvention.Cdecl)]
       static extern int unzOpenCurrentFile2 (UnzipHandle handle,
                                              out int method,
                                              out int level,
                                              int raw);

Looking over MonoPosixHelper, it *appears* this consists largely of Zlib. Zlib is already installed on Mac/iOS in /usr/lib. So, in theory, P/Invoke should work given a few tweaks to the DllImport.

However, I cannot find any function called "unzOpenCurrentFile2" in MonoPosixHelper. I found some sort of mapping in WindowBase's IOFunctions.cs, but I'm not sure I understand it's purpose, nor if it is in any way related to this.

I can't shake the feeling that simply changing that DllImport is all I need, but I am too confused by the naming to be sure. Any pointers would be greatly appreciated!

p.s. My apologies if this double-posts, I got some sort of bounce message.



More information about the Mono-devel-list mailing list