## CamelStreamFs

CamelStreamFs

## Synopsis

                        CamelStreamFs;
    CamelStream *       camel_stream_fs_new_with_name       (const gchar *name,
                                                             gint flags,
                                                             mode_t mode,
                                                             GError **error);
    CamelStream *       camel_stream_fs_new_with_name_and_bounds
                                                            (const gchar *name,
                                                             gint flags,
                                                             mode_t mode,
                                                             goffset start,
                                                             goffset end,
                                                             GError **error);
    CamelStream *       camel_stream_fs_new_with_fd         (gint fd);
    CamelStream *       camel_stream_fs_new_with_fd_and_bounds
                                                            (gint fd,
                                                             goffset start,
                                                             goffset end,
                                                             GError **error);
    gint                camel_stream_fs_get_fd              (CamelStreamFs *stream);

## Object Hierarchy

      GObject
       +----CamelObject
             +----CamelStream
                   +----CamelSeekableStream
                         +----CamelStreamFs

## Description

## Details

### CamelStreamFs

    typedef struct _CamelStreamFs CamelStreamFs;

### camel_stream_fs_new_with_name ()

    CamelStream *       camel_stream_fs_new_with_name       (const gchar *name,
                                                             gint flags,
                                                             mode_t mode,
                                                             GError **error);

Creates a new CamelStreamFs corresponding to the named file, flags, and mode.

`name` : | a local filename
`flags` : | flags as in open(2)
`mode` : | a file mode
`error` : | return location for a GError, or `NULL`
Returns : | the new stream, or `NULL` on error.

### camel_stream_fs_new_with_name_and_bounds ()

    CamelStream *       camel_stream_fs_new_with_name_and_bounds
                                                            (const gchar *name,
                                                             gint flags,
                                                             mode_t mode,
                                                             goffset start,
                                                             goffset end,
                                                             GError **error);

Creates a new CamelStream corresponding to the given arguments.

`name` : | a local filename
`flags` : | flags as in open(2)
`mode` : | a file mode
`start` : | the first valid position in the file
`end` : | the first invalid position in the file, or CAMEL_STREAM_UNBOUND
`error` : | return location for a GError, or `NULL`
Returns : | the stream, or `NULL` on error.

### camel_stream_fs_new_with_fd ()

    CamelStream *       camel_stream_fs_new_with_fd         (gint fd);

Creates a new fs stream using the given file descriptor `fd` as the backing store. When the stream is destroyed, the file descriptor will be closed.

`fd` : | a file descriptor
Returns : | a new CamelStreamFs

### camel_stream_fs_new_with_fd_and_bounds ()

    CamelStream *       camel_stream_fs_new_with_fd_and_bounds
                                                            (gint fd,
                                                             goffset start,
                                                             goffset end,
                                                             GError **error);

Gets a stream associated with the given file descriptor and bounds. When the stream is destroyed, the file descriptor will be closed.

`fd` : | a file descriptor
`start` : | the first valid position in the file
`end` : | the first invalid position in the file, or CAMEL_STREAM_UNBOUND
`error` : |
Returns : | the bound stream

### camel_stream_fs_get_fd ()

    gint                camel_stream_fs_get_fd              (CamelStreamFs *stream);

`stream` : | a CamelStream
Returns : |

Since 2.32