Next: , Previous: GnomeVFSVolumeMonitor, Up: Top


13 MIME typing

functions to get a mime-type for a file using its name or its content

13.1 Overview

13.2 Usage

— Function: gnome-vfs-mime-type-from-name (filename mchars) ⇒  (ret mchars)

gnome_vfs_mime_type_from_name’ is deprecated and should not be used in newly-written code. This function is deprecated, use gnome-vfs-get-mime-type-for-name instead.

Determine the mime type for filename.

Returns:

filename
a filename (the file does not necessarily exist).
ret
the mime-type for this filename. Will return ‘GNOME_VFS_MIME_TYPE_UNKNOWN’ if mime-type could not be found.
— Function: gnome-vfs-get-mime-type-common (uri <gnome-vfsuri>) ⇒  (ret mchars)

Tries to guess the mime type of the file represented by uri. Favors using the file data to the uri extension. Handles uri of a non-existent file by falling back on returning a type based on the extension. If cant find the mime-type based on the extension also then returns 'application/octet-stream'.

FIXME: This function will not necessarily return the same mime type as doing a get file info on the text uri.

uri
a real file or a non-existent uri.
ret
the mime-type for uri.
— Function: gnome-vfs-get-mime-type-from-uri (uri <gnome-vfsuri>) ⇒  (ret mchars)

Tries to guess the mime type of the file uri by checking the file name extension. Works on non-existent files.

uri
a file uri.
ret
the mime-type for file at uri.
— Function: gnome-vfs-mime-type-is-supertype (mime_type mchars) ⇒  (ret bool)
mime-type
a const char * identifying a mime type.
ret
Whether mime-type is of the form "foo‘/’*".
— Function: gnome-vfs-mime-info-cache-reload (dir mchars)

Reload the mime information for the dir.

dir
directory path which needs reloading.
— Function: gnome-vfs-mime-reload

Reload the MIME database.

— Function: gnome-vfs-mime-shutdown

gnome_vfs_mime_shutdown’ is deprecated and should not be used in newly-written code. This function doesn't have to be called as the operating system automatically cleans up resources when exiting.

Unload the MIME database from memory.