Wrapper for a file-like object.
stream – the stream to read from or write to
Return whether object supports random access.
If False, seek(), tell() and truncate() will raise OSError. This method may need to do a test seek().
Seek to a given position in the stream.
Truncate file to size bytes.
File pointer is left unchanged. Size defaults to the current IO position as reported by tell(). Returns the new size.
Flush the stream.
Return whether object was opened for reading.
If False, read() will raise OSError.
Read data from the stream.
size (int) – number of bytes to read
data read from the stream
Return whether object was opened for writing.
If False, write() will raise OSError.
Write data to the stream.
data – a data to write to the stream
Flush and close the IO object.
This method has no effect if the file is already closed.
Wrapper for a file-like object that supports __len__ interface