Re: gdk_input_add



"Dugas, Alan" <alan dugas analog com> writes:

> Currently I'm trying to read a file that gets updated asynchronously.
> gtk_timeout_add() seems to cause racing conditions.  gdk_input_add() locks
> up my cpu.  Does anyone have a method for asynchonously reading a file that
> works?
> 
> 
> 
> 				-- Stupid Genius
> P.S.
> I've seen some messages regarding gdk_input_add() which advise against using
> it to monitor a file (i.e. it will always have data for reading, etc).  Can
> anyone comment on this?

Yes. You can't use Unix's select() or poll() features to look
for updates for a file. That's just not the way Unix works,
for better or worse. And gdk_input_add() comes down to this
in the end.

You'll just have check the file periodically in a timeout;
that's what 'tail -f' does.

Regards,
                                        Owen




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