FileResourceHandle#
- class lsst.resources._resourceHandles._fileResourceHandle.FileResourceHandle(mode: str, log: logging.Logger, uri: ResourcePath, *, encoding: str | None, newline: str = '\n')#
Bases:
BaseResourceHandle[U]File based specialization of
BaseResourceHandle.Parameters#
- mode
str Handle modes as described in the python
iomodule.- log
Logger Logger to used when writing messages.
- uri
lsst.resources.ResourcePath URI of the file on the filesystem to use.
- encoding
stror None Optionally supply the encoding of the file.
- newline
str When doing multiline operations, break the stream on given character. Defaults to newline. If a file is opened in binary mode, this argument is not used, as binary files will only split lines on the binary newline representation.
Notes#
Documentation on the methods of this class line should refer to the corresponding methods in the
iomodule.Attributes Summary
Methods Summary
close()fileno()flush()read([size])readable()readline([size])readlines([hint])seek(offset[, whence])seekable()tell()truncate([size])writable()write(b)writelines(lines)Attributes Documentation
- closed#
- isatty#
- mode#
- name#
Methods Documentation
- close() None#
- fileno() int#
- flush() None#
- read(size: int = -1) U#
- readable() bool#
- readline(size: int = -1) U#
- readlines(hint: int = -1) Iterable[U]#
- seek(offset: int, whence: int = 0) int#
- seekable() bool#
- tell() int#
- truncate(size: int | None = None) int#
- writable() bool#
- write(b: U) int#
- writelines(lines: Iterable) None#
- mode