cwd: false,
args: false,
exceptions : false,
- debug : true,
+ debug : false,
/**
* @property output {String} resulting output
*/
* @property err_ch {GLib.IOChannel} stderr io channel
*/
err_ch : false,
-
/**
*
* @method run
* Run the configured command.
- *
+ * result is applied to object properties (eg. 'output' or 'stderr')
+ * @returns {Object} self.
*/
-
-
run : function()
{
}
- this.in_ch = GLib.io_channel_unix_new(ret.standard_input);
- this.out_ch = GLib.io_channel_unix_new(ret.standard_output);
- this.err_ch = GLib.io_channel_unix_new(ret.standard_error);
+ this.in_ch = new GLib.IOChannel.unix_new(ret.standard_input);
+ this.out_ch = new GLib.IOChannel.unix_new(ret.standard_output);
+ this.err_ch = new GLib.IOChannel.unix_new(ret.standard_error);
// make everything non-blocking!
if (this.pid !== false) {
// child can exit before we get this far..
if (this.listeners.input) {
+ print("Trying to call listeners");
try {
this.write(this.listeners.input.call(this));
+ // this probably needs to be a bit smarter...
+ //but... let's close input now..
+ this.in_ch.close();
+ _this.in_ch = false;
+
+
+
+
+
} catch (e) {
tidyup();
throw e;
if (!this.in_ch) {
return 0; // input is closed
}
- var ret = {};
- var res = this.in_ch.write_chars(str, str.length);
+ //print("write: " + str);
+ // NEEDS GIR FIX! for return value.. let's ignore for the time being..
+ //var ret = {};
+ //var res = this.in_ch.write_chars(str, str.length, ret);
+ var res = this.in_ch.write_chars(str, str.length);
+
+ //print("write_char retunred:" + JSON.stringify(res) + ' ' +JSON.stringify(ret) );
+
if (res != GLib.IOStatus.NORMAL) {
throw "Write failed";
}
- return ret.bytes_written;
+ //return ret.value;
+ return str.length;
},