(index ("identify" 0))
(def (sig (procedure "(identify [object [flags]]) => string" (id identify))) (p (tt "identify") " returns a textual description of the file indicated by " (tt "object") ", or the contents of " (tt "(current-input-port)") " if no " (tt "object") " is specified.") (p "If " (tt "object") " is given, it may be any of the following types, with " (tt "identify") " returning a description of:") (ul (li (tt "blob") ": the contents of the blob.") (li (tt "string") ": the contents of the file indicated by the given filename.") (li (tt "integer") ": the contents of that file descriptor.") (li (tt "input-port") ": the contents of the port. This port must be backed by a file descriptor; if not, an error of type " (tt "(exn type)") " will be raised.")) (p "If " (tt "flags") " is given, it should be a symbol or list of symbols indicating the type of description to return. These correspond to the " (tt "MAGIC_*") " constants in " (tt "magic.h") ", and can be any combination of the following (though not all combinations make sense):") (ul (li (tt "apple")) (li (tt "compress")) (li (tt "device")) (li (tt "mime")) (li (tt "mime-encoding encoding")) (li (tt "mime-type type")) (li (tt "no-apptype")) (li (tt "no-cdf")) (li (tt "no-compress")) (li (tt "no-elf")) (li (tt "no-encoding")) (li (tt "no-soft")) (li (tt "no-tar")) (li (tt "no-text")) (li (tt "no-tokens")) (li (tt "none")) (li (tt "preserve-atime")) (li (tt "raw")) (li (tt "symlink"))) (p "For example:") (highlight scheme "(identify \"/usr/include/magic.h\") ; => \"C source, ASCII text\"\n(identify \"/usr/include/magic.h\" 'mime) ; => \"text/x-c; charset=us-ascii\"\n(identify \"/usr/include/magic.h\" '(preserve-atime no-text)) ; => \"data\"") (p "An unrecognized flag will raise an exception of type " (tt "(exn magic)") "."))
