I'm quite happily using Archive::Zip, but what I'm missing is a test wether the file is a zip file or not.
I receive attached files (*.txt, *.log and *.zip) by email.
My Mailprogram now calls my perl-prg
and 'delivers' all attachements as tmp-files (/tmp/../uihm7934.tmp),
so I'm loosing the post-scripts to recognize wether it is a zip-file or not.
No I want to check if the actual file (kluai8qwz.tmp) is it a zip-file (-> continue) or not (->next).
Right now I try to access that file
and I get this (unnecessary) errormessage:status = zip->read( $tmp );
Well the Error_Code is set as well, but this would be enough.format error: can't find EOCD signature Archive::Zip::Archive::_findEndOfCentralDirectory('Archive::Zi +p::Archive=HASH(0x85fd7ac)','IO::File=GLOB(0x85fd974)') called at /us +r/lib/perl5/sit e_perl/5.8.3/Archive/Zip.pm line 955 Archive::Zip::Archive::readFromFileHandle('Archive::Zip::Archi +ve=HASH(0x85fd7ac)','IO::File=GLOB(0x85fd974)','/tmp/kde-cas/kmailn0q +acc.tmp') calle d at /usr/lib/perl5/site_perl/5.8.3/Archive/Zip.pm line 929 Archive::Zip::Archive::read('Archive::Zip::Archive=HASH(0x85fd +7ac)','/tmp/kde-cas/kmailn0qacc.tmp') called at /home/QTS/bin/zipBarC +.pl line 52
Does anybody know a more elegant way of a zip-check?
Thanks in advance
Carl
Carl
In reply to check *.tmp wether it's a zip or not by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |