Index: sdk/lib/io/process.dart |
diff --git a/sdk/lib/io/process.dart b/sdk/lib/io/process.dart |
index a977b319b6173dd8bfe70d0cf62bfb952217c7ad..ef6d8ab343d046ece7e2b8b7a406715ef89c0530 100644 |
--- a/sdk/lib/io/process.dart |
+++ b/sdk/lib/io/process.dart |
@@ -100,6 +100,18 @@ void sleep(Duration duration) { |
int get pid => _ProcessUtils._pid(null); |
/** |
+ * Modes for running a new process. |
+ */ |
+enum ProcessStartMode { |
+ /// Normal child process. |
+ NORMAL, |
+ /// Detached child process. |
+ DETACHED, |
+ /// Detachad clild process with stdin, stdout and stderr connected. |
Lasse Reichstein Nielsen
2015/01/30 12:11:37
clild -> child
Connected to what?
Søren Gjesse
2015/02/02 13:56:44
Done.
|
+ DETACHED_WITH_STDIO |
+} |
+ |
+/** |
* The means to execute a program. |
* |
* Use the static [start] and [run] methods to start a new process. |
@@ -258,12 +270,24 @@ abstract class Process { |
* stderr.addStream(process.stderr); |
* }); |
* |
- * If [detach] is `true` a detached process will be created. A |
- * detached process has no connection to its parent, and can |
- * keep running on its own when the parent dies. The only |
+ * If [mode] is [ProcessStartMode.NORMAL] a normal child process |
+ * will be started. |
Lasse Reichstein Nielsen
2015/01/30 12:11:37
Explain what "normal" means, or rephrase as:
If [
Søren Gjesse
2015/02/02 13:56:44
Done.
|
+ * |
+ * If `mode` is [ProcessStartMode.DETACHED] a detached process will |
+ * be created. A detached process has no connection to its parent, |
+ * and can keep running on its own when the parent dies. The only |
* information available from a detached process is its `pid`. There |
- * is no connection to its `stdin`, `stdout` or `stderr` nor will its |
- * exit code become available when it terminates. |
+ * is no connection to its `stdin`, `stdout` or `stderr` nor will |
Lasse Reichstein Nielsen
2015/01/30 12:11:37
comma before "nor"?
Søren Gjesse
2015/02/02 13:56:44
Done.
|
+ * its exit code become available when it terminates. |
+ * |
+ * If `mode` is [ProcessStartMode.DETACHED_WITH_STDIO] a detached |
+ * process will be created where the `stdin`, `stdout` and `stderr` |
+ * are connected. The creator can communication with the child. When |
Lasse Reichstein Nielsen
2015/01/30 12:11:37
can communication with the child ->
can communica
Søren Gjesse
2015/02/02 13:56:44
Done.
|
+ * these communication channels are closed the detached process will |
Lasse Reichstein Nielsen
2015/01/30 12:11:37
Rewrite as: The detached process will keep running
Søren Gjesse
2015/02/02 13:56:44
Done.
|
+ * keep running. Its exit code will not become available when it |
Lasse Reichstein Nielsen
2015/01/30 12:11:37
Its -> The process'
Søren Gjesse
2015/02/02 13:56:44
Done.
|
+ * terminated. |
Lasse Reichstein Nielsen
2015/01/30 12:11:37
terminated -> terminates.
Søren Gjesse
2015/02/02 13:56:44
Done.
|
+ * |
+ * The default value for `mode` is `ProcessStartMode.NORMAL`. |
*/ |
external static Future<Process> start( |
String executable, |
@@ -272,7 +296,7 @@ abstract class Process { |
Map<String, String> environment, |
bool includeParentEnvironment: true, |
bool runInShell: false, |
- bool detach: false}); |
+ ProcessStartMode mode: ProcessStartMode.NORMAL}); |
/** |
* Starts a process and runs it non-interactively to completion. The |