[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Unix invocation (was Re: Inferring the location of a Lua script)
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 30 Apr 2010 19:24:38 +0200
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.