<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="GUnixOutputStream">
<refmeta>
<refentrytitle role="top_of_page" id="GUnixOutputStream.top_of_page">GUnixOutputStream</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GIO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GUnixOutputStream</refname>
<refpurpose>Streaming output operations for Unix file descriptors</refpurpose>
</refnamediv>

<refsynopsisdiv id="GUnixOutputStream.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gio/gunixoutputstream.h&gt;

                    <link linkend="GUnixOutputStream-struct">GUnixOutputStream</link>;
<link linkend="GOutputStream">GOutputStream</link> *     <link linkend="g-unix-output-stream-new">g_unix_output_stream_new</link>            (<link linkend="gint">gint</link> fd,
                                                         <link linkend="gboolean">gboolean</link> close_fd);
<link linkend="void">void</link>                <link linkend="g-unix-output-stream-set-close-fd">g_unix_output_stream_set_close_fd</link>   (<link linkend="GUnixOutputStream">GUnixOutputStream</link> *stream,
                                                         <link linkend="gboolean">gboolean</link> close_fd);
<link linkend="gboolean">gboolean</link>            <link linkend="g-unix-output-stream-get-close-fd">g_unix_output_stream_get_close_fd</link>   (<link linkend="GUnixOutputStream">GUnixOutputStream</link> *stream);
<link linkend="gint">gint</link>                <link linkend="g-unix-output-stream-get-fd">g_unix_output_stream_get_fd</link>         (<link linkend="GUnixOutputStream">GUnixOutputStream</link> *stream);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GUnixOutputStream.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="GOutputStream">GOutputStream</link>
         +----GUnixOutputStream
</synopsis>
</refsect1>





<refsect1 id="GUnixOutputStream.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GUnixOutputStream--close-fd">close-fd</link>&quot;                 <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GUnixOutputStream--fd">fd</link>&quot;                       <link linkend="gint">gint</link>                  : Read / Write / Construct Only
</synopsis>
</refsect1>



<refsect1 id="GUnixOutputStream.description" role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="GUnixOutputStream"><type>GUnixOutputStream</type></link> implements <link linkend="GOutputStream"><type>GOutputStream</type></link> for writing to a
unix file descriptor, including asynchronous operations. The file
descriptor must be selectable, so it doesn't work with opened files.
</para>
<para>
Note that <filename>&lt;gio/gunixoutputstream.h&gt;</filename> belongs 
to the UNIX-specific GIO interfaces, thus you have to use the
<filename>gio-unix-2.0.pc</filename> pkg-config file when using it.</para>
<para>
</para>
</refsect1>

<refsect1 id="GUnixOutputStream.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GUnixOutputStream-struct" role="struct">
<title>GUnixOutputStream</title>
<indexterm zone="GUnixOutputStream-struct"><primary sortas="UnixOutputStream">GUnixOutputStream</primary></indexterm><programlisting>typedef struct _GUnixOutputStream GUnixOutputStream;</programlisting>
<para>
Implements <link linkend="GOutputStream"><type>GOutputStream</type></link> for outputting to selectable unix file descriptors</para>
<para>
</para></refsect2>
<refsect2 id="g-unix-output-stream-new" role="function">
<title>g_unix_output_stream_new ()</title>
<indexterm zone="g-unix-output-stream-new"><primary sortas="unix_output_stream_new">g_unix_output_stream_new</primary></indexterm><programlisting><link linkend="GOutputStream">GOutputStream</link> *     g_unix_output_stream_new            (<link linkend="gint">gint</link> fd,
                                                         <link linkend="gboolean">gboolean</link> close_fd);</programlisting>
<para>
Creates a new <link linkend="GUnixOutputStream"><type>GUnixOutputStream</type></link> for the given <parameter>fd</parameter>. 
</para>
<para>
If <parameter>close_fd</parameter>, is <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, the file descriptor will be closed when 
the output stream is destroyed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>fd</parameter>&#160;:</term>
<listitem><simpara> a UNIX file descriptor
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>close_fd</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> to close the file descriptor when done
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="GOutputStream"><type>GOutputStream</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-unix-output-stream-set-close-fd" role="function" condition="since:2.20">
<title>g_unix_output_stream_set_close_fd ()</title>
<indexterm zone="g-unix-output-stream-set-close-fd" role="2.20"><primary sortas="unix_output_stream_set_close_fd">g_unix_output_stream_set_close_fd</primary></indexterm><programlisting><link linkend="void">void</link>                g_unix_output_stream_set_close_fd   (<link linkend="GUnixOutputStream">GUnixOutputStream</link> *stream,
                                                         <link linkend="gboolean">gboolean</link> close_fd);</programlisting>
<para>
Sets whether the file descriptor of <parameter>stream</parameter> shall be closed
when the stream is closed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GUnixOutputStream"><type>GUnixOutputStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>close_fd</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> to close the file descriptor when done
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.20</para></refsect2>
<refsect2 id="g-unix-output-stream-get-close-fd" role="function" condition="since:2.20">
<title>g_unix_output_stream_get_close_fd ()</title>
<indexterm zone="g-unix-output-stream-get-close-fd" role="2.20"><primary sortas="unix_output_stream_get_close_fd">g_unix_output_stream_get_close_fd</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_unix_output_stream_get_close_fd   (<link linkend="GUnixOutputStream">GUnixOutputStream</link> *stream);</programlisting>
<para>
Returns whether the file descriptor of <parameter>stream</parameter> will be
closed when the stream is closed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GUnixOutputStream"><type>GUnixOutputStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the file descriptor is closed when done

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.20</para></refsect2>
<refsect2 id="g-unix-output-stream-get-fd" role="function" condition="since:2.20">
<title>g_unix_output_stream_get_fd ()</title>
<indexterm zone="g-unix-output-stream-get-fd" role="2.20"><primary sortas="unix_output_stream_get_fd">g_unix_output_stream_get_fd</primary></indexterm><programlisting><link linkend="gint">gint</link>                g_unix_output_stream_get_fd         (<link linkend="GUnixOutputStream">GUnixOutputStream</link> *stream);</programlisting>
<para>
Return the UNIX file descriptor that the stream writes to.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GUnixOutputStream"><type>GUnixOutputStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The file descriptor of <parameter>stream</parameter>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.20</para></refsect2>

</refsect1>
<refsect1 id="GUnixOutputStream.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GUnixOutputStream--close-fd" role="property"><title>The <literal>&quot;close-fd&quot;</literal> property</title>
<indexterm zone="GUnixOutputStream--close-fd" role="2.20"><primary sortas="UnixOutputStream:close-fd">GUnixOutputStream:close-fd</primary></indexterm><programlisting>  &quot;close-fd&quot;                 <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>
Whether to close the file descriptor when the stream is closed.</para>
<para>
</para><para>Default value: TRUE</para>
<para>Since 2.20</para>
</refsect2>
<refsect2 id="GUnixOutputStream--fd" role="property"><title>The <literal>&quot;fd&quot;</literal> property</title>
<indexterm zone="GUnixOutputStream--fd" role="2.20"><primary sortas="UnixOutputStream:fd">GUnixOutputStream:fd</primary></indexterm><programlisting>  &quot;fd&quot;                       <link linkend="gint">gint</link>                  : Read / Write / Construct Only</programlisting>
<para>
The file descriptor that the stream writes to.</para>
<para>
</para><para>Default value: -1</para>
<para>Since 2.20</para>
</refsect2>
</refsect1>



<refsect1 id="GUnixOutputStream.see-also">
<title>See Also</title>
#GOutputStream
</refsect1>

</refentry>
