man File::MimeInfo::Rox () - Open files by mimetype "Rox style"

NAME

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

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 CWChoices directories for a program to handle that mimetype.

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

EXPORT

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

ENVIRONMENT

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

METHODS

Try to open CW$file with the appropriate program for files of it's mimetype. You can use CW$mimetype to force the mimetype. Also if you allready know the mimetype it saves a lot of time to just tell it. If either the mimetype couldn't be determinated or no appropriate program could be found CWundef is returned. If the actual system failes an exception is raised. All remaining arguments are passed on to the handler. Like CWmime_system() but uses exec instead of system, so it never returns if successful. Returns the list CW($dir, $file) for the suggested place to write new script files (or symlinks) for mimetype CW$mimetype. The suggested dir doesn't need to exist.

BUGS

Please mail the author when you encounter any bugs.

AUTHOR

Jaap Karssenberg || Pardus [Larus] <pardus@cpan.org>

Copyright (c) 2003 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>