Re: g_spawn & g_io_channel: part II



Tim MÃller wrote:

Haven't looked at it in detail, but doing

 g_free(line);
 g_print("%s\n", line);

doesn't look right.

I've attached a small program that spawns a program (wget) and uses io channels to read its stdout and stderr from the pipes. It saves stdout in a buffer, and prints stderr to the text view. If you rename the stdout and stderr iochannel callback functions (ie. swap their names), you'll get stdout in the text view instead Should be easy enough to adapt for your purposes.

Cheers
-Tim
Thank You Tim, this is just what I wanted and the code _IS_ _CLEAR_ ^_^ to understand.

--
"This is it... This is where I belong... "





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