UnixInputStream

class UnixInputStream(**properties: Any)

Superclasses: InputStream, Object

Implemented Interfaces: FileDescriptorBased, PollableInputStream

GUnixInputStream implements InputStream for reading from 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/gunixinputstream.h> belongs to the UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file or the GioUnix-2.0 GIR namespace when using it.

Constructors

class UnixInputStream
classmethod new(fd: int, close_fd: bool) InputStream

Creates a new UnixInputStream for the given fd.

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

Parameters:
  • fd – a UNIX file descriptor

  • close_fdTrue to close the file descriptor when done

Methods

class UnixInputStream
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 reads from.

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 UnixInputStream
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 reads from.

Added in version 2.20.

Fields

class UnixInputStream
parent_instance
priv