After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 708838 - Wish: g_output_stream_write_all_bytes()
Wish: g_output_stream_write_all_bytes()
Status: RESOLVED DUPLICATE of bug 679662
Product: glib
Classification: Platform
Component: gio
2.38.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-09-26 13:44 UTC by Matthew Barnes
Modified: 2013-09-26 14:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthew Barnes 2013-09-26 13:44:52 UTC
g_output_stream_write_bytes() forces callers to deal with the possibility of partial writes, which is extremely inconvenient given that GBytes is immutable.

When writing a GBytes to an output stream, I would assume the caller almost always wants the entire buffer written to the stream, stopping only on error.  Similar to g_output_stream_write_all().

Ryan tells me changing g_output_stream_write_bytes() to behave this way would break compatibility, therefore I'd like to ask for a new set of functions which behave the way I initially thought g_output_stream_write_bytes() behaved:

   g_output_stream_write_all_bytes()
   g_object_stream_write_all_bytes_async()
   g_output_stream_write-all_bytes_finish()
Comment 1 Dan Winship 2013-09-26 14:29:27 UTC
bug 679662 comment 5 explains why they work the way they do now, but yeah, we want the _all versions too.

*** This bug has been marked as a duplicate of bug 679662 ***