Chromium Code Reviews| Index: sdk/lib/io/stdio.dart |
| diff --git a/sdk/lib/io/stdio.dart b/sdk/lib/io/stdio.dart |
| index 0865aaee7fd9e59df08a1f6a657e5bbc5ca753e4..d707584aaf563054d0637e6f272bbc45d589d960 100644 |
| --- a/sdk/lib/io/stdio.dart |
| +++ b/sdk/lib/io/stdio.dart |
| @@ -171,6 +171,7 @@ class _StdSink implements IOSink { |
| Future get done => _sink.done; |
| } |
| +/// The type of object an IO stream is attached to. |
|
floitsch
2013/11/08 02:20:24
Any IO stream, or just stdout, stdin and stderr?
|
| class StdioType { |
| static const StdioType TERMINAL = const StdioType._("terminal"); |
| static const StdioType PIPE = const StdioType._("pipe"); |
| @@ -187,6 +188,7 @@ IOSink _stdout; |
| IOSink _stderr; |
| +/// The standard input stream of data read by this program. |
| Stdin get stdin { |
| if (_stdin == null) { |
| _stdin = _StdIOUtils._getStdioInputStream(); |
| @@ -195,6 +197,7 @@ Stdin get stdin { |
| } |
| +/// The standard output stream of data written by this program. |
| IOSink get stdout { |
| if (_stdout == null) { |
| _stdout = _StdIOUtils._getStdioOutputStream(1); |
| @@ -203,6 +206,7 @@ IOSink get stdout { |
| } |
| +/// The standard output stream of errors written by this program. |
| IOSink get stderr { |
| if (_stderr == null) { |
| _stderr = _StdIOUtils._getStdioOutputStream(2); |
| @@ -211,6 +215,8 @@ IOSink get stderr { |
| } |
| +/// For a stream, returns whether it is attached to a file, pipe, terminal, or |
| +/// something else. |
| StdioType stdioType(object) { |
| if (object is _StdStream) { |
| object = object._stream; |