On Wed, 3 Sep 2008, Greg Ewing wrote:
> The Unix read() system call doesn't treat EOF as special other than it
> won't return bytes from "beyond" EOF and therefore even when reading a
> regular file could return fewer (including 0) bytes than asked for in
> the call.
No, that's not right -- a read of more than 0 bytes will
always block until at least 1 byte is available, or
something happens that counts as an EOF condition.
However, with some devices it's possible for what
counts as EOF to happen more than once, e.g. ttys.
Sorry, you're absolutely right. I was thinking only of the fact that
read() at EOF is not an error, rather than the blocking behaviour. It
sounds like Python read() really is very similar to Unix read() in
behaviour.
Isaac Morland CSCF Web Guru
DC 2554C, x36650 WWW Software Specialist
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com