File::MimeInfo::Magic - Online Linux Manual PageSection : 3pm
Updated : 2020-10-31
Source : perl v5.30.3
Note : User Contributed Perl Documentation
NAMEFile::MimeInfo::Magic − Determine file type with magic
SYNOPSIS use File::MimeInfo::Magic;
my $mime_type = mimetype($file);
DESCRIPTIONThis module inherits from File::MimeInfo, it is transparent to its functions but adds support for the freedesktop magic file. Magic data is hashed when you need it for the first time. If you want to force hashing earlier use the rehash() function.
EXPORTThe method mimetype is exported by default. The methods magic, inodetype, globs and describe can be exported on demand.
METHODSSee also File::MimeInfo for methods that are inherited. mimetype($file) Returns a mime-type string for $file, returns undef on failure. This method bundles inodetype(), globs() and magic(). Magic rules with an priority of 80 and higher are checked before globs() is called, all other magic rules afterwards. If this doesn't work the file is read and the mime-type defaults to 'text/plain' or to 'application/octet−stream' when the first ten chars of the file match ascii control chars (white spaces excluded). If the file doesn't exist or isn't readable undef is returned. If $file is an object reference only magic and the default method are used. See below for details. magic($file) Returns a mime-type string for $file based on the magic rules, returns undef on failure. $file can be an object reference, in that case it is supposed to have a seek() and a read() method. This allows you for example to determine the mimetype of data in memory by using IO::Scalar. Be aware that when using a filehandle or an IO:: object you need to set the :utf8 binmode yourself if appropriate. rehash() Rehash the data files. Glob and magic information is preparsed when this method is called. If you want to by-pass the XDG basedir system you can specify your database directories by setting @File::MimeInfo::DIRS. But normally it is better to change the XDG basedir environment variables. default describe extensions globs inodetype These routines are imported from File::MimeInfo.
SEE ALSOFile::MimeInfo
LIMITATIONSOnly word sizes of 1, 2 or 4 are supported. Any other word size is ignored and will cause a warning.
AUTHORJaap Karssenberg <pardus@cpan.org> Maintained by Michiel Beijen <michiel.beijen@gmail.com>
COPYRIGHTCopyright (c) 2003, 2012 Jaap G Karssenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. 0
Johanes Gumabo
Data Size : 11,102 byte
man-File::MimeInfo::Magic.3pmBuild : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 5 / 167,214
Visitor ID : :
Visitor IP : 18.119.19.251 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (parse_manual_page_|249|File::MimeInfo::Magic.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\|
) (htmlprn|149|File::MimeInfo::Magic.3pm|36/37|.el══─{─══. ds -- — |.el══─{─══. ds -- \|\(em\|
) (parse_manual_page_|249|File::MimeInfo::Magic.3pm|43|br══─}─══|'br══─}─══
) (htmlprn|149|File::MimeInfo::Magic.3pm|43|'br══─}─══ |'br══─}─══
)