g_io_channel can't read till pipe closes

I am trying to learn more about glib/gtk+ programming, so for a first
program I decided to write a wrapper for a command line program (in my
case, Cisco's VPN client). I am getting unexpected results though.

I am using g_spawn_async_with_pipes to start the command line
tool(vpnclient), then creating a g_io_channel from vpnclient's stdout
and adding a watch. What I have found though, is that my handler never
gets called till vpnclient is killed.

I have created a test program that produces the same output as the real
vpnclient, and that one works just fine, so I can't understand what I'm
doing wrong. I suspect that the program is doing some
interactive-terminal-specific things that a simple spawning of the app
can't reproduce, but I'm still not sure where to go from there. 

(I tried running "bash -i", thinking I could have bash launch vpnclient
but it doesn't seem to be controllable through g_spawn_async_with_pipes

Thanks for any suggestions you can give.
Mark Roach

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