JayGee
JayGee

Reputation: 577

Is there a command I can run from **inside** a Lua script that will tell me where the currently running Lua executable is located?

I'm using lua inside another (Windows) application that provides a lua scripting interface. Is there a way for me to know which lua executable is being used? I know the version, but I would like to know where is the lua.exe that is running.

Upvotes: 0

Views: 184

Answers (1)

Nicol Bolas
Nicol Bolas

Reputation: 473976

Lua is an embedded scripting language; that is the design of the thing. Lua is designed and intended to be incorporated into other programs. Lua.exe is essentially just a tiny shim over the Lua runtime, Lua being incorporated into a small console application. This is useful for using Lua as a console scripting language, but Lua.exe is in no way required to use Lua.

Lua scripts are not expected to know or care about the environment in which they run, except for in exactly the ways that this environment provides for them to detect. Lua as a language therefore has no mechanism to detect anything about the nature of the environment. If an embedded Lua environment wants you to be able to query such things, it will provide a mechanism for you to do so.

Upvotes: 2

Related Questions