- SEE ALSO
File::MMagic::XS - Guess File Type With XS (a la mod_mime_magic)
use File::MMagic::XS; my $m = File::MMagic::XS->new(); my $mime = $m->get_mime($file);
This is a port of Apache2 mod_mime_magic.c in Perl, written in XS with the aim of being efficient and fast especially for applications that need to be run for an extended amount of time.
Currently this software is in beta. If you have suggestions/recommendations about the interface or anything else, now is your chance to send them!
Creates a new File::MMagic::XS object.
If you specify the
file argument, then File::MMagic::XS will load magic definitions from the specified file. If unspecified, it will use the magic file that will be installed under File/MMagic/ directory.
Read and parse a magic file, as used by Apache2.
Inspects the file specified by
$file and returns a MIME type if possible. If no matching MIME type is found, then undef is returned.
Inspects a file and returns a MIME type using inode information only. The contents of the file is not inspected.
Inspects a piece of data (assuming it's not binary data), and attempts to determine the file type.
Returns the last error string.
Rate perl xs perl 89.1/s -- -100% xs 24390/s 27283% --
Hey, I told you it's fast...
Add File::MMagic interface compatibility?
Use PerlIO_* abstraction?
Copyright 2005 Daisuke Maki <firstname.lastname@example.org>. Development funded by Brazil Ltd <http://b.razil.jp>.
Underlying software: Copyright 1999-2004 The Apache Software Foundation, Copyright (c) 1996-1997 Cisco Systems, Inc., Copyright (c) Ian F. Darwin, 1987. Written by Ian F. Darwin.