static int main (string[] args) {
// A reference to our file
var file = File.new_for_path ("data.txt");
- var m = new Monitor();
+ var m = new Spawn();
return 0;
}
delegate void SpawnErr(string line);
delegate string SpawnInput();
-
-struct SpawnConfig {
+
+public class SpawnConfig {
public string cwd;
public string[] args;
public string[] env;
public SpawnErr stderr;
public SpawnInput input;
// defaults..
- public SpawnConfig() {
- cwd = "";
- args = [];
- env = [];
- async = false;
- exceptions = false;
- debug = false;
- output = null;
- stderr = null;
- input = null;
-
+ public SpawnConfig(
+ string cwd,
+ string[] args,
+ string[] env,
+ boolean async,
+ boolean exceptions,
+ boolean debug,
+
+ ) {
+ cwd = "";
+ args = [];
+ env = [];
+ async = false;
+ exceptions = false;
+ debug = false;
+ output = null;
+ stderr = null;
+ input = null;
+
}
}
this.cfg = cfg;
- this.cwd = this.cfg.cwd.length || GLib.get_home_dir();
- if (!this.cfg.args.length) {
- throw "No arguments";
- }
- this.run();
+ this.cwd = this.cfg.cwd.length || GLib.get_home_dir();
+ if (!this.cfg.args.length) {
+ throw "No arguments";
+ }
+ this.run();
}