OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 // TODO(ager): The only reason for this class is that we | 7 // TODO(ager): The only reason for this class is that we |
8 // cannot patch a top-level at this point. | 8 // cannot patch a top-level at this point. |
9 class _ProcessUtils { | 9 class _ProcessUtils { |
10 external static _exit(int status); | 10 external static _exit(int status); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 external static Future<ProcessResult> run(String executable, | 77 external static Future<ProcessResult> run(String executable, |
78 List<String> arguments, | 78 List<String> arguments, |
79 [ProcessOptions options]); | 79 [ProcessOptions options]); |
80 | 80 |
81 /** | 81 /** |
82 * Returns an input stream of the process stdout. | 82 * Returns an input stream of the process stdout. |
83 * | 83 * |
84 * Throws an [UnsupportedError] if the process is | 84 * Throws an [UnsupportedError] if the process is |
85 * non-interactive. | 85 * non-interactive. |
86 */ | 86 */ |
87 InputStream get stdout; | 87 Stream<List<int>> get stdout; |
88 | 88 |
89 /** | 89 /** |
90 * Returns an input stream of the process stderr. | 90 * Returns an input stream of the process stderr. |
91 * | 91 * |
92 * Throws an [UnsupportedError] if the process is | 92 * Throws an [UnsupportedError] if the process is |
93 * non-interactive. | 93 * non-interactive. |
94 */ | 94 */ |
95 InputStream get stderr; | 95 Stream<List<int>> get stderr; |
96 | 96 |
97 /** | 97 /** |
98 * Returns an output stream to the process stdin. | 98 * Returns an output stream to the process stdin. |
99 * | 99 * |
100 * Throws an [UnsupportedError] if the process is | 100 * Throws an [UnsupportedError] if the process is |
101 * non-interactive. | 101 * non-interactive. |
102 */ | 102 */ |
103 OutputStream get stdin; | 103 IOSink<Process> get stdin; |
104 | 104 |
105 /** | 105 /** |
106 * Sets an exit handler which gets invoked when the process | 106 * Sets an exit handler which gets invoked when the process |
107 * terminates. | 107 * terminates. |
108 * | 108 * |
109 * Throws an [UnsupportedError] if the process is | 109 * Throws an [UnsupportedError] if the process is |
110 * non-interactive. | 110 * non-interactive. |
111 */ | 111 */ |
112 void set onExit(void callback(int exitCode)); | 112 Future<int> exitCode; |
113 | 113 |
114 /** | 114 /** |
115 * On Windows, [kill] kills the process, ignoring the [signal] | 115 * On Windows, [kill] kills the process, ignoring the [signal] |
116 * flag. On Posix systems, [kill] sends [signal] to the | 116 * flag. On Posix systems, [kill] sends [signal] to the |
117 * process. Depending on the signal giving, it'll have different | 117 * process. Depending on the signal giving, it'll have different |
118 * meanings. When the process terminates as a result of calling | 118 * meanings. When the process terminates as a result of calling |
119 * [kill] [onExit] is called. | 119 * [kill] [onExit] is called. |
120 * | 120 * |
121 * Returns [:true:] if the process is successfully killed (the | 121 * Returns [:true:] if the process is successfully killed (the |
122 * signal is successfully sent). Returns [:false:] if the process | 122 * signal is successfully sent). Returns [:false:] if the process |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 /** | 259 /** |
260 * Contains the system message for the process exception if any. | 260 * Contains the system message for the process exception if any. |
261 */ | 261 */ |
262 final String message; | 262 final String message; |
263 | 263 |
264 /** | 264 /** |
265 * Contains the OS error code for the process exception if any. | 265 * Contains the OS error code for the process exception if any. |
266 */ | 266 */ |
267 final int errorCode; | 267 final int errorCode; |
268 } | 268 } |
OLD | NEW |