1MimeInfo::Rox(3) User Contributed Perl Documentation MimeInfo::Rox(3)
2
3
4
6 File::MimeInfo::Rox - Open files by mimetype "Rox style"
7
9 use File::MimeInfo::Magic;
10 use File::MimeInfo::Rox qw/:magic/;
11
12 # open some file with the apropriate program
13 mime_system($somefile);
14
15 # more verbose version
16 my $mt = mimetype($somefile)
17 ⎪⎪ die "Could not find mimetype for $somefile\n";
18 mime_system($somefile, $mt)
19 ⎪⎪ die "No program to open $somefile available\n";
20
22 This module tries to mimic the behaviour of the rox file browser
23 <http://rox.sf.net> when "opening" data files. It determines the mime
24 type and searches in rox's "Choices" directories for a program to han‐
25 dle that mimetype.
26
27 See the rox documentation for an extensive discussion of this mecha‐
28 nism.
29
31 The methods "mime_exec" and "mime_system" are exported, if you use the
32 export tag ":magic" you get the same methods but File::MimeInfo::Magic
33 will be used for mimetype lookup.
34
36 The environment variable "CHOICESPATH" is used when searching for rox's
37 config dirs. It defaults to
38 "$ENV{HOME}/Choices:/usr/local/share/Choices:/usr/share/Choices"
39
41 "mime_system($file)"
42 "mime_system($file, $mimetype, @_)"
43 Try to open $file with the appropriate program for files of it's
44 mimetype. You can use $mimetype to force the mimetype. Also if you
45 allready know the mimetype it saves a lot of time to just tell it.
46
47 If either the mimetype couldn't be determinated or no appropriate
48 program could be found "undef" is returned. If the actual system
49 failes an exception is raised.
50
51 All remaining arguments are passed on to the handler.
52
53 "mime_exec($file)"
54 "mime_exec($file, $mimetype, @_)"
55 Like "mime_system()" but uses exec instead of system, so it never
56 returns if successful.
57
58 "suggest_script_name($mimetype)"
59 Returns the list "($dir, $file)" for the suggested place to write
60 new script files (or symlinks) for mimetype $mimetype. The sug‐
61 gested dir doesn't need to exist.
62
64 Please mail the author when you encounter any bugs.
65
67 Jaap Karssenberg ⎪⎪ Pardus [Larus] <pardus@cpan.org>
68
69 Copyright (c) 2003 Jaap G Karssenberg. All rights reserved. This pro‐
70 gram is free software; you can redistribute it and/or modify it under
71 the same terms as Perl itself.
72
74 File::MimeInfo, File::MimeInfo::Magic, <http://rox.sourceforce.net>
75
76
77
78perl v5.8.8 2005-10-03 MimeInfo::Rox(3)