Hello all. After hours of trying, I still cannot get g_spawn_async_with_pipes working in both directions (stdin and stdout piped at the same time).
Here's the call: ok = g_spawn_async_with_pipes("/tmp", argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &std_in, &std_out, NULL, &error); The std_out file descriptor is linked to a g_io_watch by: gio_stdout = g_io_channel_unix_new(std_out); g_io_channel_set_flags(gio_stdout, G_IO_FLAG_NONBLOCK, NULL); iow_out = g_io_add_watch(gio_stdout, G_IO_IN, io_out_watch, out_txtbff); g_io_channel_unref(gio_stdout); This works if I put NULL instead of the &std_in in the call. Inversely, if I disable the &std_out (by putting NULL), std_in starts working. To have better control over the program called, I wrote the small test program below... Could someone please indicate what I doing wrong, or indicate some example of g_spawn_async_with_pipes where both channels are redirected? Thanks in advance! John #include <stdio.h> #include <string.h> int main(void) { FILE *logf; char bff[80]; printf("Here we are with the simple program\n"); do { fgets(bff, 80, stdin); bff[strlen(bff)-1] = '\0'; printf("cmd: [%s]\n", bff); } while (bff[0] != 'x'); } _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list