Re: Reading from pipes (Unix)




d93-mln@sm.luth.se writes:

> When using gdk_input_add to monitor a pipe for reading my callback
> function is called upon repeatedly. I only want it to be called once
> when there is new data to be read from the pipe. How do I do this??

You input callback will be called any time there is data available to
be read from the pipe. So, if you read all data from the pipe in your
input callback, your callback should only be called when new data
arrives.

Also, I think when the other end of the pipe is closed, your
function will be called (with 0 length when you read from
the pipe) until you close your end and remove the input callback.

Hope this helps,
                                        Owen



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