man-pages/man3/File::MimeInfo::Rox.3pm.html
2021-03-31 01:06:50 +01:00

174 lines
4.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of File::MimeInfo::Rox</TITLE>
</HEAD><BODY>
<H1>File::MimeInfo::Rox</H1>
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2018-08-06<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
File::MimeInfo::Rox - Open files by mimetype &quot;Rox style&quot;
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
use File::MimeInfo::Magic;
use File::MimeInfo::Rox qw/:magic/;
# open some file with the appropriate program
mime_system($somefile);
# more verbose version
my $mt = mimetype($somefile)
|| die &quot;Could not find mimetype for $somefile\n&quot;;
mime_system($somefile, $mt)
|| die &quot;No program to open $somefile available\n&quot;;
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
This module tries to mimic the behaviour of the rox file
browser &lt;<A HREF="http://rox.sf.net">http://rox.sf.net</A>&gt; when ``opening'' data files.
It determines the mime type and searches in rox's <TT>&quot;Choices&quot;</TT>
directories for a program to handle that mimetype.
<P>
See the rox documentation for an extensive discussion of this
mechanism.
<A NAME="lbAE">&nbsp;</A>
<H2>EXPORT</H2>
The methods <TT>&quot;mime_exec&quot;</TT> and <TT>&quot;mime_system&quot;</TT> are exported,
if you use the export tag <TT>&quot;:magic&quot;</TT> you get the same methods
but File::MimeInfo::Magic will be used for mimetype lookup.
<A NAME="lbAF">&nbsp;</A>
<H2>ENVIRONMENT</H2>
The environment variable <TT>&quot;CHOICESPATH&quot;</TT> is used when searching
for rox's config dirs. It defaults to
<TT>&quot;$ENV{HOME}/Choices:/usr/local/share/Choices:/usr/share/Choices&quot;</TT>
<A NAME="lbAG">&nbsp;</A>
<H2>METHODS</H2>
<DL COMPACT>
<DT id="1">&quot;mime_system($file)&quot;<DD>
<DT id="2">&quot;mime_system($file, $mimetype, @_)&quot;<DD>
Try to open <TT>$file</TT> with the appropriate program for files of
it's mimetype. You can use <TT>$mimetype</TT> to force the mimetype.
Also if you already know the mimetype it saves a lot of time
to just tell it.
<P>
If either the mimetype couldn't be determined or
no appropriate program could be found <TT>&quot;undef&quot;</TT> is returned.
If the actual system fails an exception is raised.
<P>
All remaining arguments are passed on to the handler.
<DT id="3">&quot;mime_exec($file)&quot;<DD>
<DT id="4">&quot;mime_exec($file, $mimetype, @_)&quot;<DD>
Like <TT>&quot;mime_system()&quot;</TT> but uses exec instead of system,
so it <B>never returns</B> if successful.
<DT id="5">&quot;suggest_script_name($mimetype)&quot;<DD>
Returns the list <TT>&quot;($dir, $file)&quot;</TT> for the suggested place
to write new script files (or symlinks) for mimetype <TT>$mimetype</TT>.
The suggested dir doesn't need to exist.
</DL>
<A NAME="lbAH">&nbsp;</A>
<H2>AUTHOR</H2>
Jaap Karssenberg &lt;<A HREF="mailto:pardus@cpan.org">pardus@cpan.org</A>&gt;
Maintained by Michiel Beijen &lt;<A HREF="mailto:michiel.beijen@gmail.com">michiel.beijen@gmail.com</A>&gt;
<A NAME="lbAI">&nbsp;</A>
<H2>COPYRIGHT</H2>
Copyright (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.
<A NAME="lbAJ">&nbsp;</A>
<H2>SEE ALSO</H2>
File::MimeInfo,
File::MimeInfo::Magic,
&lt;<A HREF="http://rox.sourceforce.net">http://rox.sourceforce.net</A>&gt;
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="8"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="9"><A HREF="#lbAE">EXPORT</A><DD>
<DT id="10"><A HREF="#lbAF">ENVIRONMENT</A><DD>
<DT id="11"><A HREF="#lbAG">METHODS</A><DD>
<DT id="12"><A HREF="#lbAH">AUTHOR</A><DD>
<DT id="13"><A HREF="#lbAI">COPYRIGHT</A><DD>
<DT id="14"><A HREF="#lbAJ">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:43 GMT, March 31, 2021
</BODY>
</HTML>