[Tutor] Simulating fileEvent

bowman bowman@montana.com
Tue, 31 Aug 1999 21:22:30 -0600


Evgeny Roubinchtein wrote:
>
> Well, I am sort of stumped on translating "fileevent": looking at its
> man page, it behaves just like the TK/Tkinter's "bind" method, except
> that "bind" calls a procedure when there's an X event, and "filevent"
> calls procedure when some input is waiting to be read, so the read
> won't 'block', so the application doesn't look "frozen" to the user.

I've been playing with that example, and haven't gotten a good solution.
popen() will work to capture the output (popen3() if you want the stderr
too), and select() allows you to test the output so it won't block on a
hung command, but it leaves a lot to be desired. Pssibly if the popen
and select were off in a thread it would come close?

-- 
Bear Technology  Making Montana safe for Grizzlies

http://people.montana.com/~bowman/