Are there known issues with rubyzip on WIndows?

Discussion in 'Ruby' started by James Britt, Sep 8, 2004.

  1. James Britt

    James Britt Guest

    I've been using rubyzip to manipulate OpenOffice.org files,and it works
    great for reading and extracting, but I've run into some issues when
    trying to create a zip file on Windows.

    It's not that I can't create a zip file; I can, and WinZip happily opens
    it. But there something quirky, because OpenOffice won't read it.

    The same ruby code running on Linux, though, works fine, producing a
    file that opens fine in OOo on both the Linux box and the windows machine.

    My test scenario for this is: Take a known good sxw file. Extract the
    internal files; rezip using rubyzip. Try to open the new doc in OOo.

    When I unzip the new doc,and compare the files with the original source
    files, they are identical. I can also use jar to zip up these files,
    and OOo is happy with the results. So it does not seem that rubyzip on
    windows munges the files themselves, but it might be doing something
    with the zip headers or structure that irks OOo.

    So, before I go too crazy trying to narrow this down, I'm wondering if
    anyone is aware of any issues or quirks with using rubyzip on Windows.

    rubyzip 0.5.0 http://sourceforge.net/projects/rubyzip
    ruby version 1.8.2

    Thanks,

    James
    James Britt, Sep 8, 2004
    #1
    1. Advertising

  2. James Britt

    James Britt Guest

    James Britt wrote:

    > I've been using rubyzip to manipulate OpenOffice.org files,and it works
    > great for reading and extracting, but I've run into some issues when
    > trying to create a zip file on Windows.
    >
    > It's not that I can't create a zip file; I can, and WinZip happily opens
    > it. But there something quirky, because OpenOffice won't read it.
    >
    > The same ruby code running on Linux, though, works fine, producing a
    > file that opens fine in OOo on both the Linux box and the windows machine.
    >
    > My test scenario for this is: Take a known good sxw file. Extract the
    > internal files; rezip using rubyzip. Try to open the new doc in OOo.
    >
    > When I unzip the new doc,and compare the files with the original source
    > files, they are identical. I can also use jar to zip up these files,
    > and OOo is happy with the results. So it does not seem that rubyzip on
    > windows munges the files themselves, but it might be doing something
    > with the zip headers or structure that irks OOo.
    >
    > So, before I go too crazy trying to narrow this down, I'm wondering if
    > anyone is aware of any issues or quirks with using rubyzip on Windows.
    >
    > rubyzip 0.5.0 http://sourceforge.net/projects/rubyzip
    > ruby version 1.8.2


    One more quirk: Same code, same Ruby, same PC, works fine when run from
    cygwin terminal rather than Windows CMD box.

    James
    James Britt, Sep 10, 2004
    #2
    1. Advertising

  3. James Britt

    James Britt Guest

    James Britt wrote:
    > One more quirk: Same code, same Ruby, same PC, works fine when run from
    > cygwin terminal rather than Windows CMD box.


    Sorry, scratch that; wrong tests. Things still not good on Windows.

    >
    > James
    >
    >
    >
    James Britt, Sep 10, 2004
    #3
  4. > Sorry, scratch that; wrong tests. Things still not good on Windows.

    Is it a problem with the files not being outputed in binary mode?

    Rob

    --
    Personal responsibility is battling extinction.
    Robert McGovern, Sep 13, 2004
    #4
  5. James Britt

    James Britt Guest

    Robert McGovern wrote:
    >>Sorry, scratch that; wrong tests. Things still not good on Windows.

    >
    >
    > Is it a problem with the files not being outputed in binary mode?


    That was my first thought, and the to-level API prevents you from
    explicitly opening or writing to zipfile objects in binary mode. But
    tit appears, from perusing the source, that the under the hood the files
    are opens in binary mode all the time.

    I find the some malformed header issue in Linux. It appears to be an
    issue with how the central and local headers are calculated.

    My basic test, on both win32 and Linux, was to create an OpenOffice.doc,
    and extract the inner files (OOo files are just a zip set of some XML
    files).

    Rezip the same files using jar, see if OOo can open the results.
    Rezip the same files using GNU zip, see if OOo can open the results.
    Rezip the same files rubyzip, see if OOo can open the results.

    The first two work fine on Linux and win32 (using cygwin's zip; PKZip
    works OK, too.)

    The last fails on both Linux and win32, and testing the file with zip -T
    gives the message about the headers.

    James
    James Britt, Sep 13, 2004
    #5
  6. James Britt

    Guest

    , Dec 12, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hermit Dave
    Replies:
    6
    Views:
    2,995
    Hermit Dave
    Jan 19, 2004
  2. Jack
    Replies:
    7
    Views:
    596
  3. Replies:
    2
    Views:
    390
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    May 4, 2006
  4. dinoo
    Replies:
    4
    Views:
    931
    Alexey Smirnov
    Jun 9, 2008
  5. Nathan Sokalski
    Replies:
    15
    Views:
    714
Loading...

Share This Page