Confused by File::MMagic's FileExts

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

   I'm using File::MMagic, and I'm confused about using FileExts.  The
doc for addFileExts states:

If a filetype cannot be determined by magic numbers, extra checks can
be done based on the file extension (actually, a regexp).

Looking at the code, addFileExts modifies the FILEEXTS hash.  The only
place where I see that hash considered is in checktype_byfilename().
However, I see no call to checktype_byfilename() anywhere in

My questions are:

1) Should checktype_byfilename() be part of the regular processing in,
say, checktype_filename()?

2) If not, then I'm assuming my code will need to make the call to
checktype_byfilename() directly if I didn't get a valid match answer
from checktype_filename().  How do I determine whether
checktype_filename() returned due to a default or due to a valid match?

[ For context, I'm trying to identify svg files. ]


Site Timeline