Re: Problems with GBufferedOutputStream

On Sat, 2009-08-15 at 00:27 +0200, Sebastian Pölsterl wrote:
> Hash: SHA1
> Jürg Billeter schrieb:
> > 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)."
> > 
> I read the documentation, too. But non of the issues mentioned is
> applicable here. If the behavior is intended I'd have absolutely no idea
> why one would need such a function.

"e.g." means "for example". It is not an exhaustive list of possible
reasons for a short write. Any i/o code needs to correctly handle short
writes. I agree that it would be nice to additionally fix
BufferedOutputStream for this case, but its by no means a bug.

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