.. # split from OEPlatformFunctions.rst:560

.. include:: ../substitutions

.. oe:namespace:: OEPlatform

.. meta::
   :keywords: OEOpenOStream

.. oe:function:: OEOpenOStream

   .. oe:language:: c++ java csharp

      .. oe:api::

         oeostream* OEOpenOStream(const char *)

   .. oe:language:: python

      .. oe:api:: python

         OEOpenOStream(arg1: str) -> oeostream

   Creates and returns an :ref:`oeostream <OEPlatform_oeostream>` output stream
   capable of writing to the
   specified target parameter. The target parameter is initially
   parsed to determine whether a colon delimited protocol was
   specified. If no protocol was specified, it is assumed that the
   target parameter refers to a filename. If a protocol was specified,
   the function checks to see whether an output stream allocator and
   deallocator have been registered to handle to the appropriate
   protocol. If the specified protocol has been registered, the
   appropriate output stream will be created and returned, otherwise
   the function will return ``0``. Allocators and deallocators for
   specific protocols can be registered using the
   :oe:func:`OEPlatform::OERegisterOStream` function.

   .. code-block:: c++

       oeostream *os = OEOpenOStream("pipe: uniq > output.txt");

   In addition, this function will attempt to assess whether or not
   the output data target expects compressed data. If the expected
   format is supported, the appropriate compression wrapper stream
   will be used to dynamically compress the data.

   .. warning::

      All streams created with this function MUST be closed with the
      :oe:func:`OEPlatform::OECloseOStream` function.

