OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 void _exit(int status); | 10 external static void _exit(int status); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 IOSink get stdin; | 249 IOSink get stdin; |
250 | 250 |
251 /** | 251 /** |
252 * Returns the process id of the process. | 252 * Returns the process id of the process. |
253 */ | 253 */ |
254 int get pid; | 254 int get pid; |
255 | 255 |
256 /** | 256 /** |
257 * On Windows, [kill] kills the process, ignoring the [signal] | 257 * On Windows, [kill] kills the process, ignoring the [signal] |
258 * flag. On Posix systems, [kill] sends [signal] to the | 258 * flag. On Posix systems, [kill] sends [signal] to the |
259 * process. Depending on the signal giving, it'll have different | 259 * process. Depending on the signal send, it'll have different |
260 * meanings. When the process terminates as a result of calling | 260 * meanings. When the process terminates as a result of calling |
261 * [kill] [onExit] is called. | 261 * [kill], the [exitCode] future is completed with the exit code. |
262 * | 262 * |
263 * Returns [:true:] if the process is successfully killed (the | 263 * Returns [:true:] if the process is successfully killed (the |
264 * signal is successfully sent). Returns [:false:] if the process | 264 * signal is successfully sent). Returns [:false:] if the process |
265 * could not be killed (the signal could not be sent). Usually, | 265 * could not be killed (the signal could not be sent). Usually, |
266 * a [:false:] return value from kill means that the process is | 266 * a [:false:] return value from kill means that the process is |
267 * already dead. | 267 * already dead. |
268 */ | 268 */ |
269 bool kill([ProcessSignal signal = ProcessSignal.SIGTERM]); | 269 bool kill([ProcessSignal signal = ProcessSignal.SIGTERM]); |
270 } | 270 } |
271 | 271 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 final int errorCode; | 390 final int errorCode; |
391 | 391 |
392 const ProcessException(this.executable, this.arguments, [this.message = "", | 392 const ProcessException(this.executable, this.arguments, [this.message = "", |
393 this.errorCode = 0]); | 393 this.errorCode = 0]); |
394 String toString() { | 394 String toString() { |
395 var msg = (message == null) ? 'OS error code: $errorCode' : message; | 395 var msg = (message == null) ? 'OS error code: $errorCode' : message; |
396 var args = arguments.join(' '); | 396 var args = arguments.join(' '); |
397 return "ProcessException: $msg\n Command: $executable $args"; | 397 return "ProcessException: $msg\n Command: $executable $args"; |
398 } | 398 } |
399 } | 399 } |
OLD | NEW |