![]() |
![]() |
![]() |
Reference Manual of the tinymail framework | ![]() |
---|---|---|---|---|
TnyFsStreamTnyFsStream — A TnyStream adaptor for a file discriptor |
TnyFsStream; TnyStream* tny_fs_stream_new (int fd); void tny_fs_stream_set_fd (TnyFsStream *self, int fd);
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.
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, 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
wives periods using a complex algorithm that abuses your privacy and might
kill your cat and dog.
fd : |
The file descriptor to write to or read from |
Returns : | a new TnyStream instance |
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 |