Chromium Code Reviews| Index: sdk/lib/io/process.dart |
| diff --git a/sdk/lib/io/process.dart b/sdk/lib/io/process.dart |
| index 5ca1597656995076dedcdf240ea722906b657edf..e5c758e4de0803c9586e12ab27f65d38a7be2097 100644 |
| --- a/sdk/lib/io/process.dart |
| +++ b/sdk/lib/io/process.dart |
| @@ -95,6 +95,14 @@ abstract class Process { |
| * streams of processes started with [:Process.start:]. If the user |
| * does not read all data on the streams the underlying system |
| * resources will not be freed since there is still pending data. |
| + * |
| + * The following code uses `Process.start` to grep for `main` in the |
| + * file `test.dart` on Linux. |
| + * |
| + * Process.start('grep', ['-i', 'main', 'test.dart']).then((p) { |
| + * p.stdout.pipe(stdout); |
|
Anders Johnsen
2013/11/20 12:24:04
Please use `stdout.addStream(p.stdout)` and likewi
Søren Gjesse
2014/01/02 09:19:30
Done.
|
| + * p.stderr.pipe(stderr); |
| + * }); |
| */ |
| external static Future<Process> start( |
| String executable, |
| @@ -136,6 +144,14 @@ abstract class Process { |
| * Returns a `Future<ProcessResult>` that completes with the |
| * result of running the process, i.e., exit code, standard out and |
| * standard in. |
| + * |
| + * The following code uses `Process.run` to grep for `main` in the |
| + * file `test.dart` on Linux. |
| + * |
| + * Process.run('grep', ['-i', 'main', 'test.dart']).then((result) { |
| + * stdout.write(result.stdout); |
| + * stdout.write(result.stderr); |
|
Anders Johnsen
2013/11/20 12:24:04
stderr.write
Søren Gjesse
2014/01/02 09:19:30
Done.
|
| + * }); |
| */ |
| external static Future<ProcessResult> run( |
| String executable, |