Re: Problems with GBufferedOutputStream



On Fri, 2009-08-14 at 20:49 +0200, Sebastian Pölsterl wrote:
> I came across a problem with GBufferedOutputStream and
> g_output_stream_write recently. If I try to write more data than the
> buffer size, not everything is written to the file.

>From the documentation of g_output_stream_write:

"On success, the number of bytes written to the stream is returned. It
is not an error if this is not the same as the requested size, as it can
happen e.g. on a partial i/o error, or if there is not enough storage in
the stream. All writes either block until at least one byte is written,
so zero is never returned (unless count is zero)."

Use g_output_stream_write_all if you want to make sure that all bytes
are written (as long as there is no error).

Cheers,
Jürg



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]