开发者

Get back the output of os.execute in Lua [duplicate]

This question already has answers here: 开发者_JS百科 Closed 11 years ago.

Possible Duplicate:

Get back the output of os.execute in Lua

I want to assign the result of a shell command to a lua variable.

Any better way in lua 5.1 than what is answered here? Get back the output of os.execute in Lua


You can use io.popen for this (included in Lua 5.1). That gives you a file handle which you can use to either write or read from (to) the program. More info in the Lua Manual.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜