lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 21 February 2011 17:51, Dimiter "malkia" Stanev <malkia@gmail.com> wrote:
> Hi Alex,
>
> Wouldn't argv[0] that is given to main() work for Linux?
> I guess in the situation where luajit is .so, .dll, or .dylib that won't be
> easy. But maybe there is a compiler specific global __argv, etc.

I don't think you can guarantee argv[0] is always set appropriately
(though it will be for anything launched from a shell). The logic is
more complicated - you'd have to check in cwd, then through every path
in $PATH.

Alex