Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Unified Diff: sdk/lib/io/process.dart

Issue 77893003: Documentation update (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/http.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « sdk/lib/io/http.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698