in reply to Checking if a file is present in a ZIP archive
Q: How can Archive::Zip can test the validity of a Zip file? A: There are two ready-to-use utilities in the examples directory that ca +n be used to test file integrity, or that you can use as examples for your own code: examples/zipcheck.pl shows how to use an attempted extraction to test +a file.
The example script uses eval and:
Archive::Zip::setErrorHandler( sub { warn shift() } );
When I run zipcheck.pl on a file which I know is not a zip file, I only get one message:
format error: can't find EOCD signature
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Checking if a file is present in a ZIP archive
by bontchev (Sexton) on Mar 25, 2011 at 20:32 UTC | |
by toolic (Bishop) on Mar 25, 2011 at 20:35 UTC | |
by bontchev (Sexton) on Mar 25, 2011 at 20:59 UTC | |
by choroba (Cardinal) on Mar 25, 2011 at 20:46 UTC |