[En-Nut-Discussion] non-blocking fgetc

Don Ingram don at led.com.au
Tue May 23 12:21:16 CEST 2006


Hi All,

A current job got me examining fgetc() in a bit of detail. Is there a 
non-blocking version of this call on a stream.   I had hoped to loop a test on a 
stream from a telnet session.

Henrik has proposed a solution but now curiosity has the better of me and I am 
looking for a solution to the fgetc() issue.  I had incorrectly assumed that if 
the stream was empty I might get on EOF or ERR response to the call when there 
wasn't anything in the stream & if a char was present I could unget it back onto 
the head of the stream.

At present the thread blocks on the fgetc() call until a char is present in the 
stream.

Any ideas?


-- 
Cheers

Don



More information about the En-Nut-Discussion mailing list