stdout属性

Stream<List<int>> stdout

进程的标准输出流,作为一个Stream

注意: stdinstdoutstderr是通过父进程和子进程之间的管道实现的。这些管道容量有限。如果子进程在不读取输出的情况下向stderr或stdout写入超过该限制,子进程会阻塞等待管道缓冲区接受更多数据。例如

import 'dart:io';

main() async {
  var process = await Process.start('cat', ['largefile.txt']);
  // The following await statement will never complete because the
  // subprocess never exits since it is blocked waiting for its
  // stdout to be read.
  await process.stderr.forEach(print);
}

实现

Stream<List<int>> get stdout;