magic
CopyrightCopyright (C) 2005 John Goerzen
LicenseBSD-3-Clause
MaintainerPhilippe <philippedev101\@gmail.com>
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Magic.Init

Description

Creating a magic handle and loading magic databases into it. A handle returned by magicOpen must be given a database with magicLoadDefault or magicLoad before it can be queried with the functions in Magic.Operations.

Written by John Goerzen.

Synopsis

Documentation

magicOpen :: [MagicFlag] -> IO Magic Source #

Create a new magic handle configured with the given flags (see MagicFlag). Before querying anything you must load a database with magicLoadDefault or magicLoad.

The handle is freed automatically when it is garbage-collected. Raises an IOError if the handle cannot be created.

magicLoad :: Magic -> String -> IO () Source #

Load the given magic database(s) into the handle. The argument may be a single path or several colon-separated paths. Raises an IOError if a database cannot be loaded.

magicLoadDefault :: Magic -> IO () Source #

Load the system's default magic database into the handle. Raises an IOError if the database cannot be loaded.