oeiofstream

class oeiofstream : public oeofstream

This class represents a file that can be both written to and read from at the same time. Note, it inherits from oeofstream and can generally be used as an output file stream. The major distinction being that the oeiofstream.pread method can be used to read data back from the file provided oeostream.flush has been called.

The following methods are publicly inherited from oeofstream:

append

fd

openfd

Constructors

oeiofstream() -> oeiofstream
oeiofstream(filename: str) -> oeiofstream

Default and copy constructors.

pread

pread(buffer: str, len: oesize_t, offset: oefpos_t) -> oesize_t

Reads ‘len’ bytes into ‘buffer’ at the specified ‘offset’ in the file. Returns the number of bytes actually read. This method allows multiple threads to safely read from a single file descriptor.

Warning

The flush method must be called before data written to this stream can be seen by the pread method.