+
+void ExternalTask::set_stdout(Destination d)
+{
+ stdout_dest = d;
+}
+
+void ExternalTask::set_stderr(Destination d)
+{
+ stderr_dest = d;
+}
+
+string ExternalTask::run_and_capture_output(const Arguments &argv, const FS::Path &wd)
+{
+ ExternalTask task(argv, wd);
+ task.set_stdout(CAPTURE);
+ task.set_stderr(IGNORE);
+ task.start();
+ if(task.wait()!=SUCCESS)
+ throw runtime_error(format("%s failed", argv.front()));
+ return task.get_output();
+}