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

Unified Diff: runtime/bin/process.dart

Issue 9863015: This is a request for comments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 months 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 | « no previous file | runtime/bin/process_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process.dart
diff --git a/runtime/bin/process.dart b/runtime/bin/process.dart
index 181f6c6e7f6f0bbfa1e0a43a071bc7c8d7f908e8..5f3f53ecc757df1ca8faec050f451219e0749850 100644
--- a/runtime/bin/process.dart
+++ b/runtime/bin/process.dart
@@ -26,17 +26,46 @@ interface Process default _Process {
[String workingDirectory]);
/**
+ * Creates a new process object and starts a process running the
zundel 2012/03/27 00:51:55 Why didn't you didn't create a subclass of Process
zundel 2012/03/27 12:33:21 I see now the relationship is inverted to what I o
Mads Ager (google) 2012/03/27 16:56:32 I see your point Eric. However, I think that havin
zundel 2012/03/27 17:48:29 This is more work for you, so I can understand why
Mads Ager (google) 2012/03/27 18:09:43 I'm not sure I follow your suggestion. You still h
+ * [executable] with the specified [arguments]. When the process has
+ * been successfully started [onStart] is called. If the process
+ * fails to start [onError] is called.
+ *
+ * [workingDirectory] specify where the process is run from. Note
+ * that the change of directory occurs before executing the process
+ * on some platforms, which may have impact when using relative
+ * paths for [executable] and [arguments].
+ *
+ * No communication via [stdin], [stdout] or [stderr] can take place
+ * with a non-interactive process. Instead, the process is run to
+ * completion at which point the exit code and stdout and stderr are
+ * supplied to the [callback] parameter.
+ */
+ Process.startNonInteractive(String executable,
Bob Nystrom 2012/03/27 00:20:01 "startNonInteractive" is a mouthful. Maybe just "r
Mads Ager (google) 2012/03/27 00:33:25 Yes, will do. The comment should state in the firs
Søren Gjesse 2012/03/27 07:03:23 The callback provides stdout and stderr as strings
Mads Ager (google) 2012/03/27 16:56:32 Adding support for specifying an encoding of the o
+ List<String> arguments,
+ String workingDirectory,
Bob Nystrom 2012/03/27 00:20:01 Seeing this repeated list of arguments between thi
Mads Ager (google) 2012/03/27 00:33:25 I completely agree that we need a better way of ha
Mads Ager (google) 2012/03/27 00:46:00 I would like to keep the simple case very easy. So
Søren Gjesse 2012/03/27 07:03:23 I am not sure about the ProcessOptions argument -
Mads Ager (google) 2012/03/27 16:56:32 I think what it buys is that you get away from the
+ void callback(int exitCode,
+ String stdout,
+ String stderr));
+
+ /**
* Returns an input stream of the process stdout.
+ *
+ * Throws a [ProcessException] if the process is non-interactive.
Bob Nystrom 2012/03/27 00:20:01 I don't think this should be a ProcessException. A
Mads Ager (google) 2012/03/27 00:33:25 Sure, I'll change that.
Søren Gjesse 2012/03/27 07:03:23 Maybe we should consider one of two: 1. make the
Mads Ager (google) 2012/03/27 16:56:32 That would be a possibility. However, since you ar
*/
InputStream get stdout();
/**
* Returns an input stream of the process stderr.
+ *
+ * Throws a [ProcessException] if the process is non-interactive.
*/
InputStream get stderr();
/**
* Returns an output stream to the process stdin.
+ *
+ * Throws a [ProcessException] if the process is non-interactive.
*/
OutputStream get stdin();
@@ -47,7 +76,10 @@ interface Process default _Process {
void set onStart(void callback());
/**
- * Sets an exit handler which gets invoked when the process terminates.
+ * Sets an exit handler which gets invoked when the process
+ * terminates.
+ *
+ * Throws a [ProcessException] if the process is non-interactive.
*/
void set onExit(void callback(int exitCode));
« no previous file with comments | « no previous file | runtime/bin/process_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698