讀取運(yùn)行的子進(jìn)程 STDERR 流.
StderrRead ( 子進(jìn)程 ID [, 取數(shù) = false [, 二進(jìn)制 =
false]] )
子進(jìn)程 ID | 子進(jìn)程 ID, 由先前調(diào)用的 Run 返回. |
取數(shù) | [可選參數(shù)] 如為 true, 函數(shù)不刪除從流中讀取字符. |
二進(jìn)制 | [可選參數(shù)] 如為 true, 函數(shù)讀取二進(jìn)制數(shù)據(jù), 而非文本(默認(rèn)為文本). |
成功: | 返回讀取的數(shù)據(jù). @extended 包含讀取的字節(jié)數(shù). |
失敗: | @error 設(shè)置為非 0 值, 到達(dá) EOF(文件尾), STDERR 不再為進(jìn)程或其他錯(cuò)誤重定向. |
; Demonstrates StdoutRead()
#include <Constants.au3>
Local $foo
= Run(@ComSpec & " /c dir
foo.bar", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
Local $line
While 1
$line
= StdoutRead($foo)
If
@error Then
ExitLoop
MsgBox(0, "STDOUT
讀取:", $line)
WEnd
While 1
$line
= StderrRead($foo)
If
@error Then
ExitLoop
MsgBox(0, "STDERR
讀取:", $line)
WEnd
MsgBox(0, "調(diào)試", "準(zhǔn)備退出...")
provider with jb51.net (unicode) |