174 lines
4.1 KiB
HTML
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"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
File::MimeInfo::Rox - Open files by mimetype "Rox style"
|
|
<A NAME="lbAC"> </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 "Could not find mimetype for $somefile\n";
|
|
mime_system($somefile, $mt)
|
|
|| die "No program to open $somefile available\n";
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
This module tries to mimic the behaviour of the rox file
|
|
browser <<A HREF="http://rox.sf.net">http://rox.sf.net</A>> when ``opening'' data files.
|
|
It determines the mime type and searches in rox's <TT>"Choices"</TT>
|
|
directories for a program to handle that mimetype.
|
|
<P>
|
|
|
|
See the rox documentation for an extensive discussion of this
|
|
mechanism.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>EXPORT</H2>
|
|
|
|
|
|
|
|
The methods <TT>"mime_exec"</TT> and <TT>"mime_system"</TT> are exported,
|
|
if you use the export tag <TT>":magic"</TT> you get the same methods
|
|
but File::MimeInfo::Magic will be used for mimetype lookup.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>ENVIRONMENT</H2>
|
|
|
|
|
|
|
|
The environment variable <TT>"CHOICESPATH"</TT> is used when searching
|
|
for rox's config dirs. It defaults to
|
|
<TT>"$ENV{HOME}/Choices:/usr/local/share/Choices:/usr/share/Choices"</TT>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>METHODS</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">"mime_system($file)"<DD>
|
|
|
|
|
|
|
|
|
|
|
|
<DT id="2">"mime_system($file, $mimetype, @_)"<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>"undef"</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">"mime_exec($file)"<DD>
|
|
|
|
|
|
|
|
|
|
|
|
<DT id="4">"mime_exec($file, $mimetype, @_)"<DD>
|
|
|
|
|
|
|
|
|
|
|
|
Like <TT>"mime_system()"</TT> but uses exec instead of system,
|
|
so it <B>never returns</B> if successful.
|
|
<DT id="5">"suggest_script_name($mimetype)"<DD>
|
|
|
|
|
|
|
|
|
|
Returns the list <TT>"($dir, $file)"</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"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
|
|
|
|
Jaap Karssenberg <<A HREF="mailto:pardus@cpan.org">pardus@cpan.org</A>>
|
|
Maintained by Michiel Beijen <<A HREF="mailto:michiel.beijen@gmail.com">michiel.beijen@gmail.com</A>>
|
|
<A NAME="lbAI"> </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"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
File::MimeInfo,
|
|
File::MimeInfo::Magic,
|
|
<<A HREF="http://rox.sourceforce.net">http://rox.sourceforce.net</A>>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </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>
|