<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 22, 2016 at 7:45 AM, Philipp Gesang <span dir="ltr"><<a href="mailto:phg@phi-gamma.net" target="_blank">phg@phi-gamma.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">···<date: 2016-01-21, Thursday>···<from: luigi scarso>···<br>
<span class=""><br>
> On Thu, Jan 21, 2016 at 10:10 PM, Patrick Gundlach <<a href="mailto:patrick@gundla.ch">patrick@gundla.ch</a>><br>
> wrote:<br>
><br>
> > >> Is there a way to prevent LuaTeX from stopping the whole process? Is<br>
> > there a function like<br>
> ><br>
</span><span class="">> Why not mimic the Unix file command in Lua ?<br>
<br>
</span>This is less trivial than it’d appear: file(1)’s recognition<br>
magic has been improved and battle-tested over the years. It’ll<br>
be hard to arrive at that level with a custom implementation,<br>
especially from a security standpoint: Scanning a well prepared<br>
user-supplied file can DOS your machine. Why not invoke file (or<br>
perhaps identify(1)) directly?<br>
<br></blockquote><div>I mean: using the magic fie from file(1)  to build  an lpeg grammar.</div><div> Not all the patters from magic, of course. </div></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">luigi<br></div>
</div></div>