SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

PK Compat

Last post 09-02-2007 9:06 PM by JohnReilly. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 01-04-2007 12:25 PM

    PK Compat

    HI

    we are creating ZIP archives in a windows environment with ICSharpCode.SharpZipLib.Zip. However, when those zip files are send to UNIX systems, they cannot uncompress them. The error message says:

    need PK compat. v4.5 (can do v2.0)

    Do we have any possibility to compress using this "V2.0" backward compatibility or can we assume that using GZIP will solve the issue?

    Regards

    Philippe

  • 01-05-2007 2:14 AM In reply to

    Re: PK Compat

    Hi,

    I presume you are using 0.85.0?  Switch to using 0.85.1.271 and backwards compatability should happen automatically.

    hth, -jr-

  • 01-16-2007 12:42 PM In reply to

    Re: PK Compat

    Hi you're right It works now.

    However, we had another issue now. We are pushing our files into a UNIX system that can't recognize the backslash "\" separator.

    How can we create an archive that will contain Forware slash only?

    Thx!

    Philippe

  • 01-21-2007 1:13 AM In reply to

    Re: PK Compat

     

    The fix depends on exactly how you are doing things but simply put dont create ZipEntry instances using names with "\".  There are NameTranform classes that support converting windows names to PKZIP format in the library.

    hth, -jr-

  • 08-30-2007 8:11 PM In reply to

    • MattO
    • Not Ranked
    • Joined on 08-30-2007
    • Posts 2

    Re: PK Compat

    Hello 

    I am using 0.85.2.329 and still get this error when extracting on the mac. It says 'PK compat. v4.5 (can do v2.1). ' I also can not extract the archives with winzip 8.1. For now I will go back to sharpziplib 0.6 which is what I used to use and it worked. Is there some kind of compatability setting property we can use?

    Thanks

  • 08-30-2007 10:30 PM In reply to

    Re: PK Compat

    Hi check out the documentation on UseZip64.  Turning this off will do the trick.

    hth, -jr-

     

  • 08-31-2007 6:13 PM In reply to

    • MattO
    • Not Ranked
    • Joined on 08-30-2007
    • Posts 2

    Re: PK Compat

    This one is solved. Someone mentioned this in another thread. You just need to set the Size property of the ZipEntry to the FileStream.Length:

    FileStream fs = File.OpenRead(filepath);
    byte[] buffer = new byte[(int)fs.Length];
    fs.Read(buffer, 0, buffer.Length);

    ZipEntry entry = new ZipEntry(Path.GetFileName(filepath));

    entry.Size = fs.Length; fs.Close();
    zos.PutNextEntry(entry);
    zos.Write(buffer, 0, buffer.Length);

    Apparently if the size isn't set a lot of older tools think it is an invalid archive.

  • 09-02-2007 9:06 PM In reply to

    Re: PK Compat

    Hi,

     

    Yes that will work as well.  It is in fact the best way of doing things.

     

    Cheers, -jr-
     

Page 1 of 1 (8 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.