lua-users home
lua-l archive

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


On Fri, Jan 14, 2011 at 8:26 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> The lfs module from LuaFileSystem is the best known method:

Nah, scratch that - sorry I have not had my tea.

You can look at arg[0] for the script name, and work from there.

Or get the debug information:

function script_path()
    -- remember to strip off the starting @
    return debug.getinfo(2, "S").source:sub(2)
end

print(script_path())

steve d.