lua-users home
lua-l archive

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

On 11/11/2010 20.11, Lorenzo Donati wrote:
-- invocation with "lua test.lua" from the command line
print(arg[-1]) --> lua

-- invocation inside SciTE
print(arg[-1]) --> "G:\root\main\core\Lua/app/Lua-sys/bin/lua.exe" -e
SCITE_RUNNING=true; io.stdout:setvbuf 'no'" "test.lua"

-- invocation by double-clicking on test.lua inside a Windows explorer
print(arg[-1]) --> G:\root\main\core\Lua\app\Lua-sys\bin\lua.exe

So I _could_ detect that a different invocation path has been taken, but
I think it would be rather cumbersome and system specific (e.g.: what if
I changed the path where the Lua interpreter resides?)

Not very clean, but... there is a slash-backslash difference in the last part of the path (forward slashes cannot be used when a Windows console is involved).