GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  FILE::MIMEINFO::ROX (3)

.ds Aq ’

NAME

File::MimeInfo::Rox - Open files by mimetype "Rox style"

CONTENTS

SYNOPSIS



  use File::MimeInfo::Magic;
  use File::MimeInfo::Rox qw/:magic/;

  # open some file with the apropriate 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";



DESCRIPTION

This module tries to mimic the behaviour of the rox file browser <http://rox.sf.net> when opening data files. It determines the mime type and searches in rox’s Choices directories for a program to handle that mimetype.

See the rox documentation for an extensive discussion of this mechanism.

EXPORT

The methods mime_exec and mime_system are exported, if you use the export tag :magic you get the same methods but File::MimeInfo::Magic will be used for mimetype lookup.

ENVIRONMENT

The environment variable CHOICESPATH is used when searching for rox’s config dirs. It defaults to $ENV{HOME}/Choices:/usr/local/share/Choices:/usr/share/Choices

METHODS

mime_system($file)
mime_system($file, $mimetype, @_) Try to open $file with the appropriate program for files of it’s mimetype. You can use $mimetype to force the mimetype. Also if you already know the mimetype it saves a lot of time to just tell it.

If either the mimetype couldn’t be determined or no appropriate program could be found undef is returned. If the actual system fails an exception is raised.

All remaining arguments are passed on to the handler.

mime_exec($file)
mime_exec($file, $mimetype, @_) Like mime_system() but uses exec instead of system, so it <B>never returnsB> if successful.
suggest_script_name($mimetype) Returns the list ($dir, $file) for the suggested place to write new script files (or symlinks) for mimetype $mimetype. The suggested dir doesn’t need to exist.

AUTHOR

Jaap Karssenberg <pardus@cpan.org> Maintained by Michiel Beijen <michiel.beijen@gmail.com>

COPYRIGHT

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.

SEE ALSO

File::MimeInfo, File::MimeInfo::Magic, <http://rox.sourceforce.net>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 FILE::MIMEINFO::ROX (3) 2015-02-23

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.