<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hello, <div><br></div><div>I'm trying to create a script that checks all the files in my 'downloaded' directory against common file types and then tells me how many of the files in that directory aren't either a GIF or a JPG file. I'm familiar with basic Python but this is the first time I've attempted anything like this and I'm looking for a little help or a point in the right direction? </div><div><br></div><div><br></div><div><div>file_sigs = {'\xFF\xD8\xFF':('JPEG','jpg'), </div><div> '\x47\x49\x46':('GIF','gif')}</div><div><br></div><div>def readFile():</div><div>    filename = r'c:/temp/downloads'  </div><div>    fh = open(filename, 'r') </div><div>    file_sig = fh.read(4) </div><div><span style="font-size: 12pt;">print '[*] check_sig() File:',filename #, 'Hash Sig:', </span></div><div><div>binascii.hexlify(file_sig) </div></div><div><br></div><div>Regards</div><div>Jade</div><div><div><br></div><div><br></div></div><div><br></div><div><br></div><div> </div><div><br></div><div> </div></div>                                    </div></body>
</html>