Gio.OutputStream.prototype.write_all
function write_all(buffer: ByteArray, cancellable: Gio.Cancellable): [ok: Boolean, bytes_written: Number(gsize)] {
// Gjs wrapper for g_output_stream_write_all()
}
Tries to write count bytes from buffer into the stream. Will block during the operation.
This function is similar to Gio.OutputStream.prototype.write, except it tries to write as many bytes as requested, only stopping on an error.
On a successful write of count bytes, true is returned, and bytes_written is set to count.
If there is an error during the operation false is returned and @error is set to indicate the error status, bytes_written is updated to contain the number of bytes written into the stream before the error occurred.
- buffer
the buffer containing the data to write.
- cancellable
optional Gio.Cancellable object, null to ignore.
- ok
true on success, false if there was an error
- bytes_written
location to store the number of bytes that was written to the stream