[cairo] Implementing cairo_read_func_t/cairo_write_func_t properly
Bernhard Fischer
bf at abenteuerland.at
Mon Jan 4 23:16:27 PST 2016
On Tuesday 05 January 2016 00:12:14 Enrico Weigelt, metux IT consult wrote:
> On 04.01.2016 08:52, Bernhard Fischer wrote:
> >> Images usually are only useful when already downloaded completely. At
> >> that you dont need streaming anymore, as you already have everything
> >> in memory or on-disk.
> >
> > *) Assume you are doing something on a file within your program and you
> > have it already opened somewhere else...
>
> Well, just dup() the already opened fd ?
It actually makes no difference if the stream function works on buffered IO
(FILE*) or direct IO (file descriptor).
However, Using both methods at the same time is NOT recommended according to
the man pages.
>
> > *) You have an open stream in your software but no file name, e.g. a tcp
> > stream, an unlinked file, a pipe to another process,...
>
> You'll have an fd then ...
So what? The stream function can be implemented with an fd as well, it makes
no difference.
Bernhard
More information about the cairo
mailing list