Compare file extension to file header
<p>I'm starting to design an application, that will, in part, run through a directory of files and compare their extensions to their file headers.</p>

<p>Does anyone have any advice as to the best way to approach this? I know I could simply have a lookup table that will contain the file's header signature. e.g., <code>JPEG: \xFF\xD8\xFF\xE0</code></p>

<p>I was hoping there might be a simper way.</p>

<p>Thanks in advance for your help.</p>
