functions to get a mime-type for a file using its name or its content
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.
<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.
<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.
mchars
) ⇒ (ret bool
)
- mime-type
- a const char * identifying a mime type.
- ret
- Whether mime-type is of the form "foo‘/’*".