TnyFsStream

TnyFsStream — A TnyStream adaptor for a file discriptor

Synopsis




                    TnyFsStream;
TnyStream*          tny_fs_stream_new                   (int fd);
void                tny_fs_stream_set_fd                (TnyFsStream *self,
                                                         int fd);

Object Hierarchy


  GObject
   +----TnyFsStream

Implemented Interfaces

TnyFsStream implements TnyStream and TnySeekable.

Description

An adaptor for a file descriptor to a TnyStream type. You need to use the standard POSIX open() syscall.

The instance will, upon destruction, close() the filedescriptor.

Details

TnyFsStream

typedef struct _TnyFsStream TnyFsStream;

A stream that adapts a filedescriptor to the TnyStream API

free-function: g_object_unref


tny_fs_stream_new ()

TnyStream*          tny_fs_stream_new                   (int fd);

Create an adaptor instance between TnyStream and a file descriptor. Note that you must not to close() fd yourself. The destructor will do that for you.

Therefore use it with care. It's more or less an exception in the framework, although whether or not you call it an exception depends on your point of view.

The the instance will on top of close() when destructing also fsync() the filedescriptor. It does this depending on its mood, the weather and your wive's periods using a complex algorithm that abuses your privacy and might kill your cat and dog (yes, both of them).

fd : The file descriptor to write to or read from
Returns : (caller-owns): a new TnyStream instance

Since 1.0 audience: tinymail-developer


tny_fs_stream_set_fd ()

void                tny_fs_stream_set_fd                (TnyFsStream *self,
                                                         int fd);

Set the file descriptor to play adaptor for

self : A TnyFsStream instance
fd : The file descriptor to write to or read from

Since 1.0 audience: tinymail-developer

See Also

TnyStream