how to read from UnixInputStream

I'm tring to spawn a command and read its output. In the sync way, I
find is fine. But in the async
way, I cannot find any information on dealing with the unix file

try the code below:

glib =;
cmd = 'uname -a';
[success,argc,argv] = glib.shell_parse_argv(cmd);
[success,pid,stdin,stdout,stderr] =
gio =;
stream = new gio.UnixInputStream({fd:stdout});

we can get a UnixInputStream, but I don't know how to use the read
method. The g_input_stream_read indicates that there should be 3
parameters, a buffer(void*), a count(gsize), a cancellable
object(GCancellable). Then, what's the corressponding type for void* in

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]