Documentation
¶
Overview ¶
Package compile builds a softmagic database from rule source on a file system, as file(1) reads a magic directory, and identifies the result by a SHA-256 of what it read. It is a separate package so that a program which only loads a compiled database, the common case, links neither the hashing nor its package initialiser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Append ¶
Append returns a database that searches base first and then extra, as file(1) searches the directories of `-m a:b`; see Database.Join. Its hash is the SHA-256 of both inputs' hashes.
func Compile ¶
Compile reads every regular file at the root of fsys, in byte order of name as the reference does, and builds the sorted database. Files whose names begin with a dot are skipped, as are directories and anything else that is not a regular file.
Types ¶
This section is empty.