.. oe:namespace:: OEDataFlow

..  _OEDataFlow_OEWriteRecord:

.. meta::
   :keywords: OEWriteRecord OERecord datarecord

.. oe:language:: c++

   .. oe:function:: OEWriteRecord

      .. oe:api::

         bool OEWriteRecord(OEPlatform::oeostream& ofs, const OERecord& record,
                            const std::string& fmt = "binary")

      Writes a record to an output stream, and returns *true* if the
      write is successful.

      ofs
        The output stream to which the record will be written.

      record
        The :ref:`OERecord <OEDataFlow_OERecord>` object to be written.

      fmt
        The format to be written. Default values is "binary". Other formats only used internally.

.. oe:language:: python

   .. oe:function:: OEWriteRecord

      .. oe:api::

         OEWriteRecord(ofs: Union[BinaryIO, TextIO, oeostream],
                       record: OERecord, fmt: str = "binary") -> bool

      Writes a record to an output stream, and returns *True* if the
      write is successful.

      ofs
        The output stream or file to which the record will be written.

      record
        The :ref:`OERecord <OEDataFlow_OERecord>` object to be written.

      fmt
        The format to be written.  Default values is "binary". Other formats only used internally.

   .. oe:function:: write_record

      **write_record** is an alias to the
      :oe:func:`OEDataFlow::OEWriteRecord` function.
