[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua 5.2-work3: luaL_loadfile no longer accepts bytecode files with a shebang
- From: Alex Queiroz <asandroq@...>
- Date: Fri, 21 May 2010 15:10:49 -0300
Hallo,
On Fri, May 21, 2010 at 2:54 PM, M Joonas Pihlaja
<jpihlaja@cc.helsinki.fi> wrote:
>
> Hey,
>
> I found this gem in Peter Cawley's excellent summary of the changes in
> 5.2-work3: luaL_loadfile no longer accepts bytecode files with a
> shebang.
>
> I've been prepending a shebang line to binaries produced by luac to
> make them automatically executable under linux:
>
> $ luac foo.lua bar.lua baz.lua
> $ echo '#! '`which lua` >theapp
> $ cat luac.out >>theapp
> $ chmod +x ./theapp
>
> This works great in lua 5.1 and avoids an extra shell script wrapper I
> used to use to invoke the interpreter. With lua 5.2-work3, this no
> longer works. Could this approach to executable bytecode files be
> supported in lua 5.2 though?
>
On Linux you can use the binfmt kernel module:
http://linux.about.com/cs/linux101/g/binfmtsupport.htm
Cheers,
--
-alex
http://www.ventonegro.org/