I want to save the output of ping command. Please tell where am I doing it wrong ?
let [res, pid, stdin, stdout, stderr] = GLib.spawn_async_with_pipes(null, ["ping","-c","1",host], null, GLib.SpawnFlags.SEARCH_PATH, null);
GLib.io_add_watch(stdout, GLib.IOCondition.IN, this._read, stdout);
Update
Quoting this from one of my replies as this adds to the problem statement.
Actually I want to create an applet for Cinnamon Desktop (Linux Mint 16) using Javascript which would ping a host and display the average ping time in the panel as its label. So I was using GLib.spawn_async_with_pipes to do the same. So please guide me through this.
Here is a Glibmm example, you should be able to translate it easily to Python:
Edit: One should also call
src_out->destroy()
when done reading to remove it from the event loop.