gnomevfs-0.11.0: Binding to the GNOME Virtual File System library.

Portabilityportable (depends on GHC)
Stabilityalpha
Maintainergtk2hs-devel@lists.sourceforge.net

System.Gnome.VFS.MIME

Contents

Description

 

Synopsis

Types

type MIMEType = StringSource

A string that will be treated as a MIME-type.

MIME Type Operations

mimeTypeFromNameOrDefaultSource

Arguments

:: FilePath

filename - the file to get the MIME-type for

-> Maybe MIMEType

defaultv - the default MIME-type to return if no match is found

-> Maybe MIMEType

the MIME-type of the filename, or defaultv

Try to determine the MIME-type of the file at filename, using only the filename and the Gnome VFS MIME type database. If the MIME-type is not found, return defaultv.

getMIMETypeCommonSource

Arguments

:: URI

uri - the URI of the file to examine

-> IO String

the guessed MIME-type

Try to get the MIME-type of the file represented by uri. This function favors the contents of the file over the extension of the filename. If the file does not exist, the MIME-type for the extension is returned. If no MIME-type can be found for the file, the function returns "application/octet-stream".

Note: This function will not necessarily return the same MIME-type as System.Gnome.VFS.Ops.getFileInfo.

getMIMETypeFromURISource

Arguments

:: URI

uri - the URI to examine

-> IO String

the guessed MIME-type

Try to get the MIME-type of the file represented by uri. This function looks only at the filename pointed to by uri.

getFileMIMEType :: FilePath -> Bool -> IO StringSource

Try to guess the MIME-type of the file represented by path. If suffixOnly is False, use the MIME-magic based lookup first. Handles non-existant files by returning a type based on the file extension.

mimeTypeIsSupertype :: String -> BoolSource

Returns True if mimeType is of the form foo/*, and False otherwise.

getSupertypeFromMIMEType :: String -> StringSource

Returns the supertype for mimeType. The supertype of an application is computed by removing its suffix, and replacing it with *. Thus, foo/bar will be converted to foo/*.

mimeInfoCacheReload :: FilePath -> IO ()Source

Reload the MIME information for the specified directory.