lua - is there a way to get path and name of the interpreter that is running current script? -


i mean situation when lua run not embedded in app standalone scripting language.

i need php_binary or sys.executable in python. possible lua ?

note the solution given lhf not general. if interpreter has been called additional command line parameters (if may case) have search arg.

in general interpreter name stored @ negative integer index defined arg. see test script:

local i_min = 0 while arg[ i_min ] i_min = i_min - 1 end i_min = i_min + 1   -- i_min lowest int index arg not nil  = i_min, #arg     print( string.format( "arg[%d] = %s", i, arg[ ] ) ) end 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -