Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

File::MMagic vs File::MimeInfo

by markjugg (Curate)
on Jun 22, 2008 at 12:55 UTC ( #693367=perlquestion: print w/ replies, xml ) Need Help??
markjugg has asked for the wisdom of the Perl Monks concerning the following question:

I'm curious if people have reviews of using File::MimeInfo::Magic as part of websites, including mod_perl. I had used File::MMagic in the past, but it hasn't been updated in two years, and has 19 open bugs, including some serious ones.

Part of the File::MMagic approach is to bundle its own "magic file" data set. File::MimeInfo instead gets its data from the operating system, making it more prone perhaps to giving different results in different environments.

Your thoughts? Consider responding with a formal review of File::MimeInfo so that others can more easily find your opinion of it.

Comment on File::MMagic vs File::MimeInfo
Re: File::MMagic vs File::MimeInfo
by clinton (Priest) on Nov 10, 2008 at 12:45 UTC
    Hi Mark

    I've got the same misgivings about File::MMagic and File::MMagic::XS as you. File::MimeInfo::Magic looks like a nicely written module, but I'm concerned about using it in my mod_perl app, because loading the module plus the magic data consumes 2-3MB of memory - memory which will become less shared with time because it lives in Perl rather than in a library.

    File::LibMagic is an XS interface to libmagic and, while it still loads 1.6MB of data, that data can be shared between children. It's not a great interface though.

    I'm considering just using a system call to file, and lose a bit of performance in order to save some memory as, in my case, these mime-type checks happen seldom.

    Clint

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://693367]
Approved by pc88mxer
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2014-12-21 16:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (106 votes), past polls