libmagic
CopyrightCopyright (C) 2005 John Goerzen
LicenseBSD
MaintainerJoey Hess,
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Magic.Operations

Description

Operations for magic programs

Written by John Goerzen, jgoerzen@complete.org

Synopsis

Guessing the type

magicFile :: Magic -> OsPath -> IO ByteString Source #

Calls the Magic system on the specified file.

magicStdin :: Magic -> IO ByteString Source #

Calls the Magic system on stdin.

magicFD :: Magic -> FD -> IO ByteString Source #

Calls the Magic system on the contents of the file descriptor.

magicString :: Magic -> String -> IO ByteString Source #

Calls the Magic system to process the given String. Please note: it is not evaluated lazily.

magicCString :: Magic -> CStringLen -> IO ByteString Source #

Lower-level function used to call the Magic system to process a C string.

Other operations

magicSetFlags :: Magic -> [MagicFlag] -> IO () Source #

Change the flags on an already-created object.