I have an executable I want to开发者_StackOverflow run using Lua ... how do I do this?
Can't seem to find any documentation anywhere about this.
You can use Lua's native 'execute' command.
Example:
os.execute("c:\\temp\\program.exe")
Sources: Lua Guide / os.execute
If you need the output of the program, use io.popen
Use os.execute
.
For someone who need using io.popen
local openPop = assert(io.popen('/bin/ls -la', 'r'))
local output = openPop:read('*all')
openPop:close()
print(output) -- > Prints the output of the command.
精彩评论