Re: redirecting output to a file with g_spawn_async

2005-10-06 Thread Colossus
Olivier Sessink wrote: Colossus wrote: Hi, I tried with g_spawn_async_with_pipes and with gspawn_async but it does not work. In the first case the output (the decompressed bzip2 file) is redirected to a GTK window so I used g_spawn_async (no pipes) but the output is directed to the shell

Re: redirecting output to a file with g_spawn_async

2005-10-06 Thread Chris Vine
On Thursday 06 October 2005 18:48, Colossus wrote: Olivier Sessink wrote: Colossus wrote: Hi, I tried with g_spawn_async_with_pipes and with gspawn_async but it does not work. In the first case the output (the decompressed bzip2 file) is redirected to a GTK window so I used g_spawn_async

Re: redirecting output to a file with g_spawn_async

2005-10-06 Thread Chris Vine
On Thursday 06 October 2005 19:16, Colossus wrote: thanks for replying. I don not read with the Unix read function but with G_IO_Channel glib functions: static gboolean ExtractToDifferentLocation (GIOChannel *ioc, GIOCondition cond, gpointer data) { if (cond (G_IO_IN | G_IO_PRI) )

Re: redirecting output to a file with g_spawn_async

2005-10-06 Thread Andreas Stricker
Colossus wrote: g_io_channel_read_line ( ioc, line, NULL, NULL, NULL ); if (line != NULL ) { fwrite ( line, 1, strlen(line) , fd ); g_free (line); } Come on, read this code carefully: If you assume that you alway extract text-only data,

Re: redirecting output to a file with g_spawn_async

2005-10-06 Thread Colossus
Andreas Stricker wrote: Come on, read this code carefully: If you assume that you alway extract text-only data, it's ok. But in all other case, you read in a line and write the data from line buffer start to the first including null byte to fd. That is really not what you want. Use a not text

Re: redirecting output to a file with g_spawn_async

2005-10-06 Thread Olivier Sessink
Colossus wrote: I tried with g_spawn_async_with_pipes and with gspawn_async but it does not work. In the first case the output (the decompressed bzip2 file) is redirected to a GTK window so I used g_spawn_async (no pipes) but the output is directed to the shell window from which I ran my

redirecting output to a file with g_spawn_async

2005-09-30 Thread Colossus
Hi, I tried with g_spawn_async_with_pipes and with gspawn_async but it does not work. In the first case the output (the decompressed bzip2 file) is redirected to a GTK window so I used g_spawn_async (no pipes) but the output is directed to the shell window from which I ran my program. How can

Re: redirecting output to a file with g_spawn_async

2005-09-30 Thread Colossus
Colossus wrote: Hi, I tried with g_spawn_async_with_pipes and with gspawn_async but it does not work. In the first case the output (the decompressed bzip2 file) is redirected to a GTK window so I used g_spawn_async (no pipes) but the output is directed to the shell window from which I ran my