M
Mazze
Hi.
I have a strange problem ... I want to create a process and capture stdout :
...
gint std_out;
char* argv[3] = {"/opt/sun-jdk-1.4.2.08/bin/java","helloworld",NULL};
//char* argv[3] = {"/usr/bin/du","/",NULL};
g_spawn_async_with_pipes("/work/", argv, NULL,
G_SPAWN_CHILD_INHERITS_STDIN,
NULL, NULL, NULL,
NULL, &std_out,NULL,
NULL);
gio_stdout = g_io_channel_unix_new(std_out);
g_io_channel_set_flags(gio_stdout, G_IO_FLAG_NONBLOCK, NULL);
g_io_add_watch(gio_stdout, G_IO_IN, printme, (void*)user_data);
...
In the case of a "normal" program , e.g. "/usr/bin/du" or anything else,
this works fine, and I can read the programs stdout.
But using the java program i dont get anything at all... !?
helloworld.java just prints "Hello world" using System.out.println.
Can anybody tell me why i cant capture the output of a java program, and
how to fix this ?
Thanks
I have a strange problem ... I want to create a process and capture stdout :
...
gint std_out;
char* argv[3] = {"/opt/sun-jdk-1.4.2.08/bin/java","helloworld",NULL};
//char* argv[3] = {"/usr/bin/du","/",NULL};
g_spawn_async_with_pipes("/work/", argv, NULL,
G_SPAWN_CHILD_INHERITS_STDIN,
NULL, NULL, NULL,
NULL, &std_out,NULL,
NULL);
gio_stdout = g_io_channel_unix_new(std_out);
g_io_channel_set_flags(gio_stdout, G_IO_FLAG_NONBLOCK, NULL);
g_io_add_watch(gio_stdout, G_IO_IN, printme, (void*)user_data);
...
In the case of a "normal" program , e.g. "/usr/bin/du" or anything else,
this works fine, and I can read the programs stdout.
But using the java program i dont get anything at all... !?
helloworld.java just prints "Hello world" using System.out.println.
Can anybody tell me why i cant capture the output of a java program, and
how to fix this ?
Thanks