how to get non-blocking file descriptors from a popen?

Erno Kuusela erno-news at erno.iki.fi
Sun Jan 27 17:36:26 EST 2002


In article <83hep8iafn.fsf at panacea.canonical.org>, Kragen Sitaker
<kragen at pobox.com> writes:

| "Donn Cave" <donn at u.washington.edu> writes:
|| You know,
|| - select & poll really use a file "descriptor" - they'll accept various
|| alternatives, but only when there's a callable fileno attribute to
|| return the file descriptor.  And when you go that way, any input
|| through a file object is liable to buffer up data that select can't
|| see, so the file object is little or no use.  Use os.read() instead.

| Isn't there a way to fix this?

turn off buffering (3rd arg to popen).

  -- erno



More information about the Python-list mailing list