关闭前面运行(run)的进程的STDIO流的所有资源.
StdioClose ( 进程ID )
进程ID | 子进程的进程ID, 由上一次调用运行(run)返回. |
成功: | 返回值为非零. |
失败: | 返回值为 0 ,如果进程没有 STDIO 流或者已经被关闭. |
; Demonstrates StdioClose()
#include <Constants.au3>
Local $pid = Run(@ComSpec & " /c dir foo.bar", @SystemDir, @SW_HIDE, $STDERR_MERGED + $STDOUT_CHILD)
StdioClose($pid)
; No data will be read because we closed all the streams we would read from.
Local $line
While 1
$line = StdoutRead($pid)
If @error Then ExitLoop
MsgBox(0, "STDOUT read:", $line)
WEnd
While 1
$line = StderrRead($pid)
If @error Then ExitLoop
MsgBox(0, "STDERR read:", $line)
WEnd
MsgBox(0, "Debug", "Exiting...")