libtcspc.BinaryFileOutputStream

final class libtcspc.BinaryFileOutputStream(filename, *, truncate=False, append=False)[source]

Bases: OutputStream

Binary output stream that writes to a file on disk.

Parameters:
  • filename (str or Param[str]) – Path to the file to write.

  • truncate (bool or Param[bool], keyword-only) – If true, truncate the file if it already exists. Default False.

  • append (bool or Param[bool], keyword-only) – If true, append to the file if it already exists. Default False.

Notes

The file is opened with unbuffered I/O. Failure to open the file is reported when the upstream WriteBinaryStream performs its first write.

See also

tcspc::binary_file_output_stream()

The underlying C++ output stream.

WriteBinaryStream

Processor that consumes this stream.