Gio.File.prototype.replace_contents_bytes_async

function replace_contents_bytes_async(contents: ByteArray, etag: String, make_backup: Boolean, flags: Gio.FileCreateFlags, cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback): void {
    // Gjs wrapper for g_file_replace_contents_bytes_async()
}
  

Same as Gio.File.prototype.replace_contents_async but takes a GLib.Bytes input instead. This function will keep a ref on contents until the operation is done. Unlike Gio.File.prototype.replace_contents_async this allows forgetting about the content without waiting for the callback.

When this operation has completed, callback will be called with @user_user data, and the operation can be finalized with Gio.File.prototype.replace_contents_finish.

Since 2.40

contents

a GLib.Bytes

etag

a new [entity tag][gfile-etag] for the file, or null

make_backup

true if a backup should be created

flags

a set of Gio.FileCreateFlags

cancellable

optional Gio.Cancellable object, null to ignore

callback

a Gio.AsyncReadyCallback to call when the request is satisfied