Lua popen 的使用

上一篇 / 下一篇  2011-06-24 18:26:59 / 个人分类:Lua

io.popen ([prog [, mode]])

Starts program prog in a separated process and returnsa file handle that you can use to read data from this program(if mode is "r", the default)or to write data to this program(if mode is "w").

This function is system dependent and is not availableon all platforms.

例:
f=io.popen("ps ax")
print(f:read("*line"))

每次print时都会读出下条进程信息

TAG:

 

评分:0

我来说两句

Open Toolbar