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

Magic.Data

Description

The MagicFlag enumeration, mapping the C libmagic MAGIC_* constants to Haskell.

Synopsis

Documentation

data MagicFlag Source #

Flags that control how libmagic examines a file and what it reports. Combine them in the list passed to magicOpen or magicSetFlags.

Constructors

MagicNone

No special handling; return a textual description (the default).

MagicDebug

Print debugging messages to stderr.

MagicSymlink

Follow symbolic links.

MagicCompress

Look inside compressed files.

MagicDevices

Look at the contents of block or character special devices.

MagicMimeType

Return a MIME type string instead of a textual description.

MagicMimeEncoding

Return the MIME encoding (character set) instead of a textual description.

MagicMime

Return both the MIME type and the encoding.

MagicContinue

Return all matches, not just the first.

MagicCheck

Check the magic database for consistency and report problems.

MagicPreserveAtime

Preserve the access time of examined files.

MagicRaw

Do not translate unprintable characters to octal escapes.

MagicError

Treat errors while examining a file as real errors instead of embedding them in the result.

MagicApple

Return the Apple creator and type.

MagicExtension

Return a slash-separated list of valid file extensions for the detected type.

MagicCompressTransp

Report on the compressed contents only, without mentioning the compression itself (transparent decompression).

MagicNoCompressFork

Do not allow decompression that requires forking a helper process.

MagicNodesc

Composite of MagicExtension, MagicMime and MagicApple: return identifiers rather than a textual description.

MagicNoCheckCompress

Do not look inside compressed files.

MagicNoCheckTar

Do not examine tar archives.

MagicNoCheckSoft

Do not consult the magic database entries (soft magic).

MagicNoCheckApptype

Do not check for an application type (e.g. EMX).

MagicNoCheckElf

Do not examine ELF details.

MagicNoCheckText

Do not examine text files.

MagicNoCheckCdf

Do not examine CDF (Microsoft Compound Document) files.

MagicNoCheckCsv

Do not examine CSV files.

MagicNoCheckTokens

Do not look for known text tokens.

MagicNoCheckEncoding

Do not check text encodings.

MagicNoCheckJson

Do not examine JSON files.

MagicNoCheckSimh

Do not examine SIMH tape files.

MagicNoCheckBuiltin

Disable all built-in tests; consult only the magic database.

UnknownMagicFlag Int

A flag value returned by libmagic that these bindings do not recognise, carrying its raw integer value.

Instances

Instances details
Enum MagicFlag Source # 
Instance details

Defined in Magic.Data

Show MagicFlag Source # 
Instance details

Defined in Magic.Data

Methods

showsPrec :: Int -> MagicFlag -> ShowS

show :: MagicFlag -> String

showList :: [MagicFlag] -> ShowS

Eq MagicFlag Source # 
Instance details

Defined in Magic.Data

Methods

(==) :: MagicFlag -> MagicFlag -> Bool

(/=) :: MagicFlag -> MagicFlag -> Bool

Ord MagicFlag Source # 
Instance details

Defined in Magic.Data

Methods

compare :: MagicFlag -> MagicFlag -> Ordering

(<) :: MagicFlag -> MagicFlag -> Bool

(<=) :: MagicFlag -> MagicFlag -> Bool

(>) :: MagicFlag -> MagicFlag -> Bool

(>=) :: MagicFlag -> MagicFlag -> Bool

max :: MagicFlag -> MagicFlag -> MagicFlag

min :: MagicFlag -> MagicFlag -> MagicFlag