/usr/share/doc/libmagic-ocaml-dev/html/Magic.html is in libmagic-ocaml-dev 0.7.3-5build9.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="Start" href="index.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Magic" rel="Chapter" href="Magic.html"><title>Magic</title>
</head>
<body>
<div class="navbar"> <a class="up" href="index.html" title="Index">Up</a>
</div>
<h1>Module <a href="type_Magic.html">Magic</a></h1>
<pre><span class="keyword">module</span> Magic: <code class="code">sig</code> <a href="Magic.html">..</a> <code class="code">end</code></pre><div class="info module top">
Try to identify the type of file using some "magic number" tests.<br>
<b>Author(s):</b> Christophe Troestler <chris_77@users.sourceforge.net><br>
<b>Version:</b> 0.7.3<br>
</div>
<hr width="100%">
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> </pre>
<div class="info ">
Magic "cookies".<br>
</div>
<pre><span id="EXCEPTIONFailure"><span class="keyword">exception</span> Failure</span> <span class="keyword">of</span> <code class="type">string</code></pre>
<div class="info ">
Raised by the functions of this library when they fail. The
string is an explanation of why the failure happened.<br>
</div>
<pre><code><span id="TYPEflag"><span class="keyword">type</span> <code class="type"></code>flag</span> = </code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTflag.Symlink"><span class="constructor">Symlink</span></span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
If the file queried is a symlink, follow it.<br>
</div>
</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTflag.Compress"><span class="constructor">Compress</span></span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
If the file is compressed, unpack it and look at the
contents.<br>
</div>
</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTflag.Devices"><span class="constructor">Devices</span></span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
If the file is a block or character special device,
then open the device and try to look in its
contents.<br>
</div>
</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTflag.Mime"><span class="constructor">Mime</span></span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
Return a mime string, instead of a textual description.<br>
</div>
</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTflag.Continue"><span class="constructor">Continue</span></span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
Return all matches, not just the first.<br>
</div>
</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTflag.Check"><span class="constructor">Check</span></span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
Check the magic database for consistency and print
warnings to stderr.<br>
</div>
</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTflag.Preserve_atime"><span class="constructor">Preserve_atime</span></span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
On systems that support utime(2) or utimes(2),
attempt to preserve the access time of files
analyzed.<br>
</div>
</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTflag.Raw"><span class="constructor">Raw</span></span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" ><div class="info ">
Don't translate unprintable characters to a \ooo octal
representation.<br>
</div>
</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>
<pre><span id="VALmake"><span class="keyword">val</span> make</span> : <code class="type">?flags:<a href="Magic.html#TYPEflag">flag</a> list -> string list -> <a href="Magic.html#TYPEt">t</a></code></pre><div class="info ">
<code class="code">make ?flags filenames</code> creates a magic cookie, loading the
databases in <code class="code">filenames</code>. If <code class="code">filenames = []</code>, the default
database is used.<br>
<b>Raises</b><ul><li><code>Magic.Failure</code> if there was an error allocating the magic cookie.</li>
<li><code>Sys_error</code> if there was an operating system error.</li>
</ul>
</div>
<div class="param_info"><code class="code">flags</code> : specifies how the other magic functions should
behave (default: <code class="code">[]</code>).</div>
<pre><span id="VALcreate"><span class="keyword">val</span> create</span> : <code class="type">?flags:<a href="Magic.html#TYPEflag">flag</a> list -> string list -> <a href="Magic.html#TYPEt">t</a></code></pre><div class="info ">
<span class="warning">Deprecated.</span>Synonym for <a href="Magic.html#VALmake"><code class="code">Magic.make</code></a>.<br>
</div>
<pre><span id="VALclose"><span class="keyword">val</span> close</span> : <code class="type"><a href="Magic.html#TYPEt">t</a> -> unit</code></pre><div class="info ">
<code class="code">close cookie</code> frees the resources associated with the cookie <code class="code">c</code>.
You need not to close cookies as the resources will be freed by
the garbage collector anyway.<br>
</div>
<pre><span id="VALfile"><span class="keyword">val</span> file</span> : <code class="type"><a href="Magic.html#TYPEt">t</a> -> string -> string</code></pre><div class="info ">
<code class="code">file cookie filename</code> returns a textual description of the
contents of the filename argument.<br>
<b>Raises</b><ul><li><code>Magic.Failure</code> if an error occurred.</li>
<li><code>Invalid_argument</code> if the cookie is closed.</li>
<li><code>Sys_error</code> if there was an operating system error.</li>
</ul>
</div>
<pre><span id="VALbuffer"><span class="keyword">val</span> buffer</span> : <code class="type"><a href="Magic.html#TYPEt">t</a> -> ?len:int -> string -> string</code></pre><div class="info ">
<code class="code">file cookie ?len buf</code> returns a textual description of the
contents of the filename argument.<br>
<b>Raises</b><ul><li><code>Magic.Failure</code> if an error occurred.</li>
<li><code>Invalid_argument</code> if <code class="code">cookie</code> is closed or if one does not
have <code class="code">0 <= len <= String.length buf</code>.</li>
</ul>
</div>
<pre><span id="VALsetflags"><span class="keyword">val</span> setflags</span> : <code class="type"><a href="Magic.html#TYPEt">t</a> -> <a href="Magic.html#TYPEflag">flag</a> list -> unit</code></pre><div class="info ">
<code class="code">setflags cookie flags</code> specifies how the other magic functions
should behave.<br>
<b>Raises</b><ul><li><code>Magic.Failure</code> if the <a href="Magic.html#TYPEflag"><code class="code">Magic.flag</code></a> <code class="code">Preserve_atime</code> is
not supported by the operating system.</li>
<li><code>Invalid_argument</code> if the cookie has been closed.</li>
</ul>
</div>
<pre><span id="VALload"><span class="keyword">val</span> load</span> : <code class="type"><a href="Magic.html#TYPEt">t</a> -> string list -> unit</code></pre><div class="info ">
<code class="code">load cookie filenames</code> loads the the list of database files
<code class="code">filenames</code>, or [] for the default database file.<br>
<b>Raises</b><ul><li><code>Invalid_argument</code> if the cookie has been closed.</li>
<li><code>Sys_error</code> if there was an operating system error.</li>
</ul>
</div>
<pre><span id="VALcompile"><span class="keyword">val</span> compile</span> : <code class="type"><a href="Magic.html#TYPEt">t</a> -> string list -> unit</code></pre><div class="info ">
<code class="code">compile cookie filenames</code> compiles the the list of database
files <code class="code">filenames</code>, or [] for the default database. The compiled
files created are named from the basename(1) of each file
argument with ".mgc" appended to it.<br>
<b>Raises</b><ul><li><code>Invalid_argument</code> if the cookie has been closed.</li>
<li><code>Sys_error</code> if there was an operating system error.</li>
</ul>
</div>
<pre><span id="VALcheck"><span class="keyword">val</span> check</span> : <code class="type"><a href="Magic.html#TYPEt">t</a> -> string list -> bool</code></pre><div class="info ">
<code class="code">check cookie filenames</code> checks the validity of entries in the
database files <code class="code">filenames</code>, or [] for the default database.<br>
<b>Raises</b> <code>Invalid_argument</code> if the cookie has been closed.<br>
</div>
</body></html>
|