From: Francis Cianfrocca Date: 2006-11-01T14:30:07+09:00 Subject: Re: Nonblocking IO read ------=_Part_10389_11390776.1162359004843 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/31/06, srobertjames@gmail.com wrote: > > How can I perform a nonblocking IO read? That is, read whatever is > there to read and return. If there's nothing yet, just return. > > Failing that, is there a way to manually check if there's anything to > read or the read will block? > > (Note that I'm developing for both 'nix and Windows.) > > > Are you having an interactive conversation with the process created by popen4? Is that why you need nbio, because you need to poll more than one stream simultaneously? You can get the file descriptors associated with stdout and stderr (they'll be 1 and 2 unless you did something unusual), set them nonblocking, and select them for reading with a short timeout. ------=_Part_10389_11390776.1162359004843--