GioUnix.OutputStream

g GObject.GInterface GObject.GInterface Gio.PollableOutputStream Gio.PollableOutputStream GObject.GInterface->Gio.PollableOutputStream GioUnix.FileDescriptorBased GioUnix.FileDescriptorBased GObject.GInterface->GioUnix.FileDescriptorBased GObject.Object GObject.Object Gio.OutputStream Gio.OutputStream GObject.Object->Gio.OutputStream GioUnix.OutputStream GioUnix.OutputStream Gio.OutputStream->GioUnix.OutputStream Gio.PollableOutputStream->GioUnix.OutputStream GioUnix.FileDescriptorBased->GioUnix.OutputStream

Subclasses:

None

Methods

Inherited:

Gio.OutputStream (29), GObject.Object (37), Gio.PollableOutputStream (5), GioUnix.FileDescriptorBased (1)

Structs:

GObject.ObjectClass (5)

class

get_close_fd (stream)

class

get_fd (stream)

class

new (fd, close_fd)

class

set_close_fd (stream, close_fd)

Virtual Methods

Inherited:

Gio.OutputStream (15), GObject.Object (7), Gio.PollableOutputStream (5)

Properties

Name

Type

Flags

Short Description

close-fd

bool

r/w

fd

int

r/w/co

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Gio.OutputStream

r

Class Details

class GioUnix.OutputStream(**kwargs)
Bases:

Gio.OutputStream, Gio.PollableOutputStream, GioUnix.FileDescriptorBased

Abstract:

No

Structure:

GioUnix.OutputStreamClass

GUnixOutputStream implements [class`Gio`.OutputStream] for writing to a UNIX file descriptor, including asynchronous operations. (If the file descriptor refers to a socket or pipe, this will use poll() to do asynchronous I/O. If it refers to a regular file, it will fall back to doing asynchronous I/O in another thread.)

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 file or the GioUnix-2.0 GIR namespace when using it.

classmethod get_close_fd(stream)
Parameters:

stream (Gio.UnixOutputStream) – a GioUnix.OutputStream

Returns:

True if the file descriptor is closed when done

Return type:

bool

Returns whether the file descriptor of stream will be closed when the stream is closed.

New in version 2.20.

classmethod get_fd(stream)
Parameters:

stream (Gio.UnixOutputStream) – a GioUnix.OutputStream

Returns:

The file descriptor of stream

Return type:

int

Return the UNIX file descriptor that the stream writes to.

New in version 2.20.

classmethod new(fd, close_fd)
Parameters:
  • fd (int) – a UNIX file descriptor

  • close_fd (bool) – True to close the file descriptor when done

Returns:

a new Gio.OutputStream

Return type:

Gio.OutputStream

Creates a new GioUnix.OutputStream for the given fd.

If close_fd, is True, the file descriptor will be closed when the output stream is destroyed.

classmethod set_close_fd(stream, close_fd)
Parameters:

Sets whether the file descriptor of stream shall be closed when the stream is closed.

New in version 2.20.

Property Details

GioUnix.OutputStream.props.close_fd
Name:

close-fd

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

Whether to close the file descriptor when the stream is closed.

New in version 2.20.

GioUnix.OutputStream.props.fd
Name:

fd

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The file descriptor that the stream writes to.

New in version 2.20.