File-MMagic reviews

RSS | Module Info

File-MMagic (1.30)

All the reviews are very negative, but the module is self-contained and works well as far as it goes, which is in identifying file formats which were common ten years ago. In my tests, it had more successes at identifying files than File::Type.

The formats it recognises are dated though, it doesn't recognise modern executable formats, XML, and SVG, and it can't really distinguish when there are non-ASCII bytes in the file. Having said that, it does a better job than File::Type in several cases.

But it seems abandoned, judging from the bug reports:

For a full comparison including source code and results on various files, see

File-MMagic (1.27) **

Works for basic usage, but has quite a few problems. Plus it is not very performant. Doesn't seem to be maintained anymore.

The currently recommended module in this area seems to be File::LibMagic. Other alternatives include File::Type (gives less useful results), File::MMagic::XS (also not actively maintained? long standing bugs like failure to parse system magic file still persists), Media::Type::Simple (only maps MIME type from/to file extension).

File-MMagic (1.27) *

This library has a great concept, but has suffered massive bit rot since it was last maintained in 2006.

Here are my main problems with the library:

1. There is no support for multi-file magic (my system has moved to a directory-based magic file system).

2. No support for newer file(1) magic syntax: cannot detect image/png using system magic from file(1) version 5.04.

2a. Not very code-hardy: code is broken by newer/unrecognized magic file syntax.

3. There are four undocumented subs which show up in the documentation, but tell nothing of their use.

4. No support for character set detection.

5. No support for long file type descriptions ("PNG image data, xxx x yyy, ...").

All in all, I would not recommend using this module until it is maintained; File::LibMagic seems like it will give you better results.

File-MMagic (1.27) ***

This is a handy module for determining the the file type of a file by examining its contents. However, it some serious bugs (currently 19 are open), and hasn't been updated in two years. I personally ran into problems with bad results under mod_perl.

I would strongly suggest looking for alternatives before using this module. If you just need to check common web image formats, File::Type::WebImages is a simple module for that purpose. It was written precisely because File::MMagic had problems in mod_perl.