Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Checking if a file is present in a ZIP archive

by bontchev (Sexton)
on Mar 25, 2011 at 20:47 UTC ( [id://895595]=note: print w/replies, xml ) Need Help??


in reply to Re: Checking if a file is present in a ZIP archive
in thread Checking if a file is present in a ZIP archive

Yes, I did try trapping the error with eval but it didn't work - it still spews a bunch of errors. I haven't used eval before, so maybe I've messed something up; I'll try again.

But if the designers have decided that the archive-processing functions should be passed only valid ZIP files, then they should have also provided a function that lets the user test if a file is a valid ZIP file. For instance, the Archive::Extract package does have such a function, but I can't use that package for various reasons (it doesn't have a function for testing the presence of a file with a specified name in the archive and it requires the presence of an unarchiving program).

  • Comment on Re^2: Checking if a file is present in a ZIP archive

Replies are listed 'Best First'.
Re^3: Checking if a file is present in a ZIP archive
by Gulliver (Monk) on Mar 25, 2011 at 21:38 UTC

    I just tried eval also (you need a semicolon after the block following eval I found out) and it was the same.

    I also tried 'no warnings;' for the block containing the read($file) and that didn't help. I have always checked the file extensions before opening something but someone could clobber my file.

    I'm curious now to look under the hood of Archive::Zip even though I probably won't understand it.

      It is probably a wrapper for a library (ZLib?) that might be spewing to STDERR. I hate it when libraries do that.
Re^3: Checking if a file is present in a ZIP archive
by toolic (Bishop) on Mar 26, 2011 at 00:41 UTC
      Hi, I am using Archive::Zip for compressing files. I am struggling to zip a file with the name contain "ÅÄÖ" characters. Actually these characters are converted as some different symbol. Can anyone give any suggestion to zip a file with the name contain the characters "ÅÄÖ"? Thanks in advance.
        Even if you succeessfully zip those files, you can cause a headache to the person who will try to unzip them (e.g. if that person works on a different OS or under different locale). Been there, seen that.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://895595]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 11:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found