GIO Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <gio/gunixoutputstream.h> GUnixOutputStream; GOutputStream * g_unix_output_stream_new (gint fd, gboolean close_fd); void g_unix_output_stream_set_close_fd (GUnixOutputStream *stream, gboolean close_fd); gboolean g_unix_output_stream_get_close_fd (GUnixOutputStream *stream); gint g_unix_output_stream_get_fd (GUnixOutputStream *stream);
GUnixOutputStream implements GOutputStream for writing to a unix file descriptor, including asynchronous operations. The file descriptor must be selectable, so it doesn't work with opened files.
Note that <gio/gunixoutputstream.h>
belongs
to the UNIX-specific GIO interfaces, thus you have to use the
gio-unix-2.0.pc
pkg-config file when using it.
typedef struct _GUnixOutputStream GUnixOutputStream;
Implements GOutputStream for outputting to selectable unix file descriptors
GOutputStream * g_unix_output_stream_new (gint fd, gboolean close_fd);
Creates a new GUnixOutputStream for the given fd
.
If close_fd
, is TRUE
, the file descriptor will be closed when
the output stream is destroyed.
|
a UNIX file descriptor |
|
TRUE to close the file descriptor when done
|
Returns : |
a new GOutputStream |
void g_unix_output_stream_set_close_fd (GUnixOutputStream *stream, gboolean close_fd);
Sets whether the file descriptor of stream
shall be closed
when the stream is closed.
|
a GUnixOutputStream |
|
TRUE to close the file descriptor when done
|
Since 2.20
gboolean g_unix_output_stream_get_close_fd (GUnixOutputStream *stream);
Returns whether the file descriptor of stream
will be
closed when the stream is closed.
|
a GUnixOutputStream |
Returns : |
TRUE if the file descriptor is closed when done
|
Since 2.20
gint g_unix_output_stream_get_fd (GUnixOutputStream *stream);
Return the UNIX file descriptor that the stream writes to.
|
a GUnixOutputStream |
Returns : |
The file descriptor of stream
|
Since 2.20
"close-fd"
property"close-fd" gboolean : Read / Write
Whether to close the file descriptor when the stream is closed.
Default value: TRUE
Since 2.20
"fd"
property"fd" gint : Read / Write / Construct Only
The file descriptor that the stream writes to.
Default value: -1
Since 2.20