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

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

Issue 21816002: Add Process.runSync for running processe synchronously. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Combined the code from https://codereview.chromium.org/22827002/ into this change Created 7 years, 4 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
Index: sdk/lib/io/process.dart
diff --git a/sdk/lib/io/process.dart b/sdk/lib/io/process.dart
index 78c13a8a0908bfd0d3d0793139a8db4d996cb5e5..0f89a300af56c2503fb669358c259f0b19f91cd3 100644
--- a/sdk/lib/io/process.dart
+++ b/sdk/lib/io/process.dart
@@ -147,6 +147,26 @@ abstract class Process {
Encoding stdoutEncoding: Encoding.SYSTEM,
Encoding stderrEncoding: Encoding.SYSTEM});
+
+ /**
+ * Starts a process and runs it to completion. This is a synchronous
+ * call and will block until the child process terminates.
+ *
+ * The arguments are the same as for `Process.run`.
+ *
+ * Returns a `ProcessResult` with the result of running the process,
+ * i.e., exit code, standard out and standard in.
+ */
+ external static ProcessResult runSync(
+ String executable,
+ List<String> arguments,
+ {String workingDirectory,
+ Map<String, String> environment,
+ bool includeParentEnvironment: true,
+ bool runInShell: false,
+ Encoding stdoutEncoding: Encoding.SYSTEM,
+ Encoding stderrEncoding: Encoding.SYSTEM});
+
/**
* Returns the standard output stream of the process as a [:Stream:].
*

Powered by Google App Engine
This is Rietveld 408576698