def is_zipfile(filename):
try:<EOL><INDENT>fpin = open(filename, "<STR_LIT:rb>")<EOL>endrec = _EndRecData(fpin)<EOL>fpin.close()<EOL>if endrec:<EOL><INDENT>return True                 <EOL><DEDENT><DEDENT>except IOError:<EOL><INDENT>pass<EOL><DEDENT>return False<EOL>
Quickly see if file is a ZIP file by checking the magic number.