Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dancer::mime(3pm) [debian man page]

Dancer::MIME(3pm)					User Contributed Perl Documentation					 Dancer::MIME(3pm)

NAME
Dancer::MIME - Singleton object to handle MimeTypes SYNOPSIS
# retrieve object instance my $mime = Data::MIME->instance(); # return a hash reference of user defined types my $types = $mime->custom_types; # return the default mime-type for unknown files $mime->default # set the default mime-type with Dancer::Config or Dancer, like set default_mime_type => "text/plain"; # or directly in your config.yml file. # add non standard mime type $mime->add_type( foo => "text/foo" ); # add an alias to an existing type $mime->add_alias( bar => "foo" ); # get mime type for standard or non standard types $nonstandard_type = $mime->for_name('foo'); $standard_type = $mime->for_name('svg'); # get mime type for a file (given the extension) $mime_type = $mime->for_file("foo.bar"); PUBLIC API
instance my $mime = Dancer::MIME->instance(); return the Dancer::MIME instance object. add_type # add nonstandard mime type $mime->add_type( foo => "text/foo" ); Add a non standard mime type or overrides an existing one. add_alias # add alias to standard or previous alias $mime->add_alias( my_jpg => 'jpg' ); Adds an alias to an existing mime type. for_name $mime->for_name( 'jpg' ); Retrieve the mime type for a standard or non standard mime type. for_file $mime->for_file( 'file.jpg' ); Retrieve the mime type for a file, based on a file extension. custom_types my $types = $mime->custom_types; Retrieve the full hash table of added mime types. name_or_type my $type = $mime->name_or_type($thing); Resolves the $thing into a content $type whether it's the name of a MIME type like "txt" or already a mime type like "text/plain". AUTHORS
This module has been written and rewritten by different people from Dancer project. LICENCE
This module is released under the same terms as Perl itself. SEE ALSO
Dancer perl v5.14.2 2011-11-30 Dancer::MIME(3pm)

Check Out this Related Man Page

update-mime-database(1) 					   User Commands					   update-mime-database(1)

NAME
update-mime-database - build the shared MIME_Info database cache SYNOPSIS
update-mime-database -h | -v | mime-dir DESCRIPTION
update-mime-database updates the shared mime-info cache according to the system described in the Shared MIME-Info Database specification from the X Desktop Group. OPTIONS
The following options are supported: -h Display a command summary. -v Display version information OPERANDS
The following operands are supported: MIME-dir The directory for which update-mime-database should rebuild the cache. This option is mandatory if no other option is pro- vided. EXAMPLES
Example 1: Update Shared mime-info Cache for /usr/share example% update-mime-database /usr/share ENVIRONMENT VARIABLES
See environ(5). EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/update-mime-datExecutable to build the shared MIME_Info database cache ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-vfs | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
Latest version of the GNOME Desktop User Guide for your platform. gnome-vfs-mime-magic(4), gnome-vfs.applications(4), gnome-vfs.keys(4), gnome-vfs.mime(4) Shared mime info at http://www.freedesktop.org. NOTES
Original man page written by Filip Von Raemdonck (mechanix@debian.org). Updated by Matt Keenan, Sun Microsystems Inc., 2004. SunOS 5.10 6 Sep 2004 update-mime-database(1)
Man Page