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

Unified Diff: runtime/bin/process_impl.dart

Issue 9108008: Add optional workingDirectory argument to Process.start. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 12 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: runtime/bin/process_impl.dart
===================================================================
--- runtime/bin/process_impl.dart (revision 2981)
+++ runtime/bin/process_impl.dart (working copy)
@@ -10,7 +10,7 @@
class _Process implements Process {
- _Process.start(String path, List<String> arguments) {
+ _Process.start(String path, List<String> arguments, [String workingDirectory]) {
Søren Gjesse 2012/01/05 09:30:47 Ling line, do either _Process.start( String p
Anders Johnsen 2012/01/05 09:50:49 Done.
if (path is !String) {
throw new ProcessException("Path is not a String: $path");
}
@@ -29,6 +29,12 @@
_arguments[i] = arguments[i];
}
+ if (workingDirectory is !String && workingDirectory !== null) {
+ throw new ProcessException(
+ "WorkingDirectory is not a String: $workingDirectory");
+ }
+ _workingDirectory = workingDirectory;
+
_in = new _Socket._internalReadOnly(); // stdout coming from process.
_out = new _Socket._internalWriteOnly(); // stdin going to process.
_err = new _Socket._internalReadOnly(); // stderr coming from process.
@@ -52,7 +58,8 @@
void start() {
var status = new _ProcessStartStatus();
bool success = _start(
Søren Gjesse 2012/01/05 09:30:47 When all arguments cannot fit on one line they sho
Anders Johnsen 2012/01/05 09:50:49 Nice to know, ty!
- _path, _arguments, _in, _out, _err, _exitHandler, status);
+ _path, _arguments, _workingDirectory, _in, _out, _err, _exitHandler,
+ status);
if (!success) {
close();
if (_errorHandler !== null) {
@@ -106,6 +113,7 @@
bool _start(String path,
List<String> arguments,
+ String workingDirectory,
Socket input,
Socket output,
Socket error,
@@ -187,6 +195,7 @@
String _path;
ObjectArray<String> _arguments;
+ String _workingDirectory;
Socket _in;
Socket _out;
Socket _err;

Powered by Google App Engine
This is Rietveld 408576698