|
|
| There's more than one way to do things | |
| PerlMonks |
Re: check *.tmp wether it's a zip or notby guha (Priest) |
| on Nov 26, 2004 at 11:17 UTC ( #410559=note: print w/ replies, xml ) | Need Help?? |
|
My quick tests show that a zip file's first four bytes seem to be 50 4B 03 04 in hexadecimal notation. That should allow you to filter out most of the non-zip files. Then you could use your zip->read() in a block eval to trap those other files that starts with the magic byte sequence. However, consider this a hack to be used only if you can't find a better-founded idea. Update:
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||