problems making zip with Archive::Zip

Discussion in 'Perl Misc' started by mcardeiro@yahoo.com, Jan 26, 2009.

  1. Guest

    Hi,

    I am having problems making a simple zip file using Archive::Zip.

    I basically want to take some files and make a zip archive that can be
    read by windoze.

    Heres my code:
    use Archive::Zip qw:)ERROR_CODES :CONSTANTS);

    my $zip = Archive::Zip->new();
    $zip->addFile('/home/eastmail/p.pdf');
    $zip->writeToFileNamed( '/home/eastmail/oBoy.zip' );


    when I run the script I get no errors and file '/home/eastmail/
    oBoy.zip' is created but when I try to open on windows I get an error
    that it is not a valid zip.

    anybody have experience making zips in perl (the documentation on this
    module is not so great).

    Mike Cardeiro
    , Jan 26, 2009
    #1
    1. Advertising

  2. Guest

    On Jan 26, 2:57 pm, Christian Winter <> wrote:

    > "when I try to open on windows" is a rather inprecise description,
    > but I take a stab and guess you are talking of the Windows Explorer
    > built-in "Zip compressed folder". If that's the case, you are
    > likely having issues with unix file names and absolute paths.



    You ROCK...I have been agonizing over this off and on for days...thank
    you chris!
    , Jan 26, 2009
    #2
    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. Graham Wood
    Replies:
    3
    Views:
    531
    A. Sinan Unur
    Jan 11, 2004
  2. Twig
    Replies:
    1
    Views:
    126
    A. Sinan Unur
    Jan 27, 2006
  3. MoshiachNow
    Replies:
    2
    Views:
    269
    Ilya Zakharevich
    Oct 4, 2006
  4. MoshiachNow

    Archive::Zip - zip file has "invalid" format

    MoshiachNow, Oct 5, 2006, in forum: Perl Misc
    Replies:
    1
    Views:
    165
  5. Bo Yang
    Replies:
    9
    Views:
    297
    -berlin.de
    Nov 20, 2006
Loading...

Share This Page