how to check how many bytes are available to read() ?

wealthychef wealthychef at mac.com
Thu Mar 14 23:26:34 EST 2002


I have a file object f.  I want to know if there are any bytes to read
from it.  I have tried using select.select([], [f], []), but I have
found that select will return [],[f],[] even if there is nothing to
read in f, so that when I call f.readline(), it blocks.
Is there a function or some way i can peer into f and see if it has
any bytes for me?  f is actually someprocess.fromchild, by the way.



More information about the Python-list mailing list