PyDocs

Nav

Generic Operating System Services

readinto

os

function · Added in 3.14
  • readinto(fd, buffer, /)
Read into a buffer object from a file descriptor.

The buffer should be mutable and bytes-like.  On success, returns the
number of bytes read.  Less bytes may be read than the size of the
buffer.  The underlying system call will be retried when interrupted by
a signal, unless the signal handler raises an exception.  Other errors
will not be retried and an error will be raised.

Returns 0 if *fd* is at end of file or if the provided *buffer* has
length 0 (which can be used to check for errors without reading data).
Never returns negative.
0 Examples
No examples for os/readinto.
See Also
No see-alsos for os/readinto
0 Notes
No notes for readinto