Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: File::MMagic vs File::MimeInfo

by clinton (Priest)
on Nov 10, 2008 at 12:45 UTC ( #722647=note: print w/ replies, xml ) Need Help??


in reply to File::MMagic vs File::MimeInfo

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


Comment on Re: File::MMagic vs File::MimeInfo
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (12)
As of 2014-07-28 17:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (205 votes), past polls