> However, you should generally use the extension instead. Not only is
> it faster than opening every file, but the extension indicates whether
> the file is meant to be treated as a GIF or JPEG. It's possible that
> some other type of file could contain the above byte sequences by
> coincidence.

I would say that's a good idea.  However I can see reasons for checking files
for the likelihood of being GIF/JPEG regardless of extension.  Since he didn't
explain his reasons we can only assume he know what he's trying to accomplish.  

If he had told us he was trying to verify that a .jpg file was indeed a .jpg
file then we would have more information and chances are good we could give him
a better solution than what he is trying to do.  If he was trying to find hidden
(renamed to exclude .jpg or .gif) then again we know more about what he is
trying to do.

I suspect he's trying to build a filter to grab images (maybe porn?) that have
been grabbed from internet sites, news groups etc.

// [EMAIL PROTECTED] -=- This sig footer was last updated Oct 05 1998 -=- \\
| From: Nathan Grass                  http://home.dreamhaven.net/zaz/ |
| Employer: ComSys http://www.comsysinc.com/  * Technical Consultant  |
\\ -=- Unless otherwise noted, expressed views are my opinions.  -=- //

Reply via email to