## GMimeStreamFs GMimeStreamFs — A low-level FileSystem stream |

## Functions

GMimeStream * | g_mime_stream_fs_new ()
GMimeStream * | g_mime_stream_fs_new_with_bounds ()
GMimeStream * | g_mime_stream_fs_new_for_path ()
gboolean | g_mime_stream_fs_get_owner ()
void | g_mime_stream_fs_set_owner ()

## Types and Values

struct | GMimeStreamFs

## Description

A simple GMimeStream implementation that sits on top of the low-level UNIX file descriptor based I/O layer.

## Functions

### g_mime_stream_fs_new ()

    GMimeStream *
    g_mime_stream_fs_new (int fd);

Creates a new GMimeStreamFs object around `fd` .

#### Parameters

fd | a file descriptor |

#### Returns

a stream using `fd` .

### g_mime_stream_fs_new_with_bounds ()

    GMimeStream *
    g_mime_stream_fs_new_with_bounds (int fd,
                                      gint64 start,
                                      gint64 end);

Creates a new GMimeStreamFs object around `fd` with bounds `start` and `end` .

#### Parameters

fd | a file descriptor |
start | start boundary |
end | end boundary |

#### Returns

a stream using `fd` with bounds `start` and `end` .

### g_mime_stream_fs_new_for_path ()

    GMimeStream *
    g_mime_stream_fs_new_for_path (const char *path,
                                   int flags,
                                   int mode);

Creates a new GMimeStreamFs object for the specified `path` .

#### Parameters

path | the path to a file |
flags | as in open(2) |
mode | as in open(2) |

#### Returns

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

Since: 2.6.18

### g_mime_stream_fs_get_owner ()

    gboolean
    g_mime_stream_fs_get_owner (GMimeStreamFs *stream);

Gets whether or not `stream` owns the backend file descriptor.

#### Parameters

stream | a GMimeStreamFs |

#### Returns

`TRUE` if `stream` owns the backend file descriptor or `FALSE` otherwise.

### g_mime_stream_fs_set_owner ()

    void
    g_mime_stream_fs_set_owner (GMimeStreamFs *stream,
                                gboolean owner);

Sets whether or not `stream` owns the backend file descriptor.

Note: `owner` should be `TRUE` if the stream should `close()` the backend file descriptor when destroyed or `FALSE` otherwise.

#### Parameters

stream | a GMimeStreamFs |
owner | `TRUE` if this stream should own the file descriptor or `FALSE` otherwise |

## Types and Values

### struct GMimeStreamFs

    struct GMimeStreamFs {
    	GMimeStream parent_object;

    	gboolean owner;
    	gboolean eos;
    	int fd;
    };

A GMimeStream wrapper around POSIX file descriptors.

#### Members

GMimeStream `parent_object`; | parent GMimeStream |
gboolean `owner`; | `TRUE` if this stream owns `fd` |
gboolean `eos`; | `TRUE` if end-of-stream |
int `fd`; | file descriptor |

## See Also

GMimeStream