在Lua中获取os.execute的输出 [英] Get back the output of os.execute in Lua
本文介绍了在Lua中获取os.execute的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在Lua中执行"os.execute"时,控制台会迅速弹出,执行命令,然后关闭.但是,有什么方法只能使用标准的Lua库来恢复控制台输出吗?
When I do an "os.execute" in Lua, a console quickly pops up, executes the command, then closes down. But is there some way of getting back the console output only using the standard Lua libraries?
推荐答案
我认为您想要这个 http://pgl.yoyo.org/luai/i/io.popen io.popen.但这并不总是编译进来的.
I think you want this http://pgl.yoyo.org/luai/i/io.popen io.popen. But it's not always compiled in.
这篇关于在Lua中获取os.execute的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文