Methods ¶
Instance methods ¶
init(path, binary=True)
Creates a FileReader for the given path. If binary is False, read the data as str
instead of bytes
. If the path starts with a protocol:
prefix, the registered Houdini File System helpers will be queried instead of treating the path as a plain disk path.
close()
→ None
Closes the stream.
fileno()
→ int
Returns the file descriptor if it has one.
readable()
→ bool
Returns True if the stream can be read from.
read(size=0)
→ bytes
Reads at most size bytes, returned as bytes. If the size is negative or omitted, return until EOF is reached.
tell()
→ int
Returns current file position.
seek(offset, whence=0)
→ None
Move to new file position. Argument offset
is a byte count. Optional argument whence
defaults to 0 (offset from start of file, offset
should be >= 0); other values are 1 (move relative to current position, positive or negative), and 2 (move relative to end of file, usually negative.
closed
: Bool
Property
True if the stream is closed.