File ID is a file type detection utility. The detection is made by analyzing the content of the file, rather than checking the file extension. The detection is done by a script and this allows 1) to update the detection definitions without having to update the whole application and 2) the user to add new detections or improve existing ones. File ID allows also to retrieve and display other information from the file.
Here are some screenshots to better illustrate the capabilities of File ID:
File ID displaying information from a Windows executable.
File ID displaying information from a Linux executable.
File ID displaying file extensions usually associated to QuickTime movies. Note that although the file extension is .jpg, it has successfully determined the file as a QT movie.
File ID displaying the MIME type for a .dmg file (Mac OS X disk image).Download:fileid_0.1_alpha.zipUsage:Double-click fileid.exe, press the
Open button and select a file or just drag'n'drop a file over the main window.
How to add support for more file types:NOTE: Only advanced or expert users should try this. Any mistake may render the script useless.
Inside the zip file, there are several files but the ones that are absolutely essential are:
* fileid.exe - no explanation needed
* magic.pas - this is the script that contains the instructions for file type detection
Unfortunately, the Help is very incomplete and I haven't found PascalScript tutorials on the web, but since it's based on Object Pascal, for those that don't know Pascal, I recommend reading the first 7 chapters of this ebook:
Essential Pascal by Marco Cantu. Also, reading the code in magic.pas is highly recommended for everyone.
If you open the magic.pas distributed in the zip file, you'll find 3 functions:
function DetectMpegAudioFile(const StartOffset: Int64): Boolean;
function DetectTextBasedFile(const StartOffset: Int64; const Encoding: Integer): Boolean;
function Identify(Extension: WideString): LongWord;The last function is the one that is called by File ID when you open/drop a file. The other two were only added for demonstration and to avoid repeating code.
Here's an example of pascalscript code that only detects PDF documents: