| Portability | portable (depends on GHC) |
|---|---|
| Stability | alpha |
| Maintainer | gtk2hs-devel@lists.sourceforge.net |
System.Gnome.VFS.MIME
Contents
Description
- type MIMEType = String
- mimeTypeFromNameOrDefault :: FilePath -> Maybe MIMEType -> Maybe MIMEType
- getMIMETypeCommon :: URI -> IO String
- getMIMETypeFromURI :: URI -> IO String
- getFileMIMETypeFast :: FilePath -> IO String
- getFileMIMEType :: FilePath -> Bool -> IO String
- mimeTypeIsSupertype :: String -> Bool
- getSupertypeFromMIMEType :: String -> String
- mimeInfoCacheReload :: FilePath -> IO ()
Types
MIME Type Operations
mimeTypeFromNameOrDefaultSource
Arguments
| :: FilePath |
|
| -> Maybe MIMEType |
|
| -> Maybe MIMEType | the MIME-type of the
filename, or |
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.
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.
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.
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.