On Fri, Jan 22, 2016 at 7:45 AM, Philipp Gesang <[email protected]> wrote:
> ···<date: 2016-01-21, Thursday>···<from: luigi scarso>··· > > > On Thu, Jan 21, 2016 at 10:10 PM, Patrick Gundlach <[email protected]> > > wrote: > > > > > >> Is there a way to prevent LuaTeX from stopping the whole process? Is > > > there a function like > > > > > Why not mimic the Unix file command in Lua ? > > This is less trivial than it’d appear: file(1)’s recognition > magic has been improved and battle-tested over the years. It’ll > be hard to arrive at that level with a custom implementation, > especially from a security standpoint: Scanning a well prepared > user-supplied file can DOS your machine. Why not invoke file (or > perhaps identify(1)) directly? > > I mean: using the magic fie from file(1) to build an lpeg grammar. Not all the patters from magic, of course. -- luigi
