lua-users home
lua-l archive

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


On Fri, Apr 30, 2010 at 7:06 PM, KHMan <keinhong@gmail.com> wrote:
> In any case arg[0] may not work as we want when fiddling with
> symbolically-linked executables in the style of busybox, I think arg[0]
> gives the symlink name. So we'd need to make a call to get the path linked
> to the symlink or check with /proc/self, which is not portable.

Yes, I had to do the symlink check for Lua for Linux so that
package.(c)path could be based on the executable location and the
whole shebang could be relocatable.

But for non-complicated scenarios, arg[0] is your friend.