UnixOutputStream

class UnixOutputStream(**properties: Any)

Superclasses: OutputStream, Object

Implemented Interfaces: FileDescriptorBased, PollableOutputStream

GUnixOutputStream implements 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.

Constructors

class UnixOutputStream
classmethod new(fd: int, close_fd: bool) OutputStream

Creates a new UnixOutputStream for the given fd.

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

Parameters:
  • fd – a UNIX file descriptor

  • close_fdTrue to close the file descriptor when done

Methods

class UnixOutputStream
get_close_fd() bool

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

Added in version 2.20.

get_fd() int

Return the UNIX file descriptor that the stream writes to.

Added in version 2.20.

set_close_fd(close_fd: bool) None

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

Added in version 2.20.

Parameters:

close_fdTrue to close the file descriptor when done

Properties

class UnixOutputStream
props.close_fd: bool

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

Added in version 2.20.

props.fd: int

The file descriptor that the stream writes to.

Added in version 2.20.

Fields

class UnixOutputStream
parent_instance
priv