<?xml version="1.0" encoding="windows-1252"?>
<node id="722647" title="Re: File::MMagic vs File::MimeInfo" created="2008-11-10 07:45:48" updated="2008-11-10 07:45:48">
<type id="11">
note</type>
<author id="523944">
clinton</author>
<data>
<field name="doctext">
Hi Mark
&lt;p&gt;I've got the same misgivings about [mod://File::MMagic] and [mod://File::MMagic::XS] as you. [mod://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.&lt;/p&gt;
&lt;p&gt;[mod://File::LibMagic] is an XS interface to &lt;c&gt;libmagic&lt;/c&gt; and, while it still loads 1.6MB of data, that data can be shared between children. It's not a great interface though.&lt;/p&gt;
&lt;p&gt;I'm considering just using a system call to &lt;c&gt;file&lt;/c&gt;, and lose a bit of performance in order to save some memory as, in my case, these mime-type checks happen seldom.&lt;/p&gt;
&lt;p&gt;Clint&lt;/p&gt;</field>
<field name="root_node">
693367</field>
<field name="parent_node">
693367</field>
</data>
</node>
