GMime.StreamFs

g GMime.Stream GMime.Stream GMime.StreamFs GMime.StreamFs GMime.Stream->GMime.StreamFs GObject.Object GObject.Object GObject.Object->GMime.Stream

Subclasses:

None

Methods

Inherited:

GMime.Stream (17), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (fd)

class

new_with_bounds (fd, start, end)

class

open (path, flags, mode)

get_owner ()

set_owner (owner)

Virtual Methods

Inherited:

GMime.Stream (10), GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

eos

bool

r

True if end-of-stream

fd

int

r

file descriptor

owner

bool

r

True if this stream owns fd

parent_object

GMime.Stream

r

parent GMime.Stream

Class Details

class GMime.StreamFs(**kwargs)
Bases:

GMime.Stream

Abstract:

No

Structure:

GMime.StreamFsClass

A GMime.Stream wrapper around POSIX file descriptors.

classmethod new(fd)
Parameters:

fd (int) – a file descriptor

Returns:

a stream using fd.

Return type:

GMime.Stream

Creates a new GMime.StreamFs object around fd.

classmethod new_with_bounds(fd, start, end)
Parameters:
  • fd (int) – a file descriptor

  • start (int) – start boundary

  • end (int) – end boundary

Returns:

a stream using fd with bounds start and end.

Return type:

GMime.Stream

Creates a new GMime.StreamFs object around fd with bounds start and end.

classmethod open(path, flags, mode)
Parameters:
  • path (str) – the path to a file

  • flags (int) – as in open(2)

  • mode (int) – as in open(2)

Raises:

GLib.Error

Returns:

a stream using for reading and/or writing to the specified file path or None on error.

Return type:

GMime.Stream

Creates a new GMime.StreamFs object for the specified path.

get_owner()
Returns:

True if self owns the backend file descriptor or False otherwise.

Return type:

bool

Gets whether or not self owns the backend file descriptor.

set_owner(owner)
Parameters:

owner (bool) – True if this stream should own the file descriptor or False otherwise

Sets whether or not self owns the backend file descriptor.

Note: owner should be True if the stream should close() the backend file descriptor when destroyed or False otherwise.