Methods ¶
close()
Closes the stream.
closed()
: → bool
True if the file is closed.
readable()
→ bool
Returns True if the stream can be read from.
writable()
→ bool
Returns True if the stream is writeable (always False for FileReader).
seekable()
→ bool
Returns True if the stream is seekable (random access).
__enter__()
→ hou.fs.FileReader
Enters a scope in which the file reader will be closed on exit.
__exit__(type, value, traceback)
→ bool
Closes the file reader. Implicitly called at the end of a scope.
read(size = 0)
→ str
Reads at most size bytes, returned as bytes. If the size is negative or ommited, return until EOF is reached.
readline()
→ str
Reads the next line from the file as bytes.
tell()
→ int
Returns current file position
seek(offset, whence = 0)
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).
__iter__()
Returns an iterator that iterates over this file, line by line.
See also |