g_spawn_async_with_pipes and g_io_add_watch problems




Hi!

I execute from my program dd and gzip both using g_spawn_async_with_pipes.
dd reads from a file and outputs data to stdout. stdout from dd is added
with g_io_add_watch. stdout from gzip is also added with g_io_add_watch.
in function that reads from dd I have a loop that reads whole data.
in that function I execute
 while (gtk_events_pending ())
        gtk_main_iteration ();
so my UI is refreshed and main loop is iterated.
but after few iterations in my loop my program locks on writing to channel
that is connected to stdin of gzip.
how to fix this problem so the function that reads from stdout gzip is
executed.
I was trying to return from the first function that reads from dd after
reading one block of data (not to the end of the data) but there was no
difference.

I probably do something wrong. how to connect this two programs together?

regards
hs



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