http://qs321.pair.com?node_id=410559


in reply to check *.tmp wether it's a zip or not

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:
Well it seems it couldn't be better founded. The byte sequence is described in the format documentation as the "Local file header signature".