Gio.File.prototype.replace_readwrite_async

function replace_readwrite_async(etag: String, make_backup: Boolean, flags: Gio.FileCreateFlags, io_priority: Number(gint), cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback): void {
    // Gjs wrapper for g_file_replace_readwrite_async()
}
  

Asynchronously overwrites the file in read-write mode, replacing the contents, possibly creating a backup copy of the file first.

For more details, see Gio.File.prototype.replace_readwrite which is the synchronous version of this call.

When the operation is finished, callback will be called. You can then call Gio.File.prototype.replace_readwrite_finish to get the result of the operation.

Since 2.22

etag

an [entity tag][gfile-etag] for the current Gio.File, or null to ignore

make_backup

true if a backup should be created

flags

a set of Gio.FileCreateFlags

io_priority

the [I/O priority][io-priority] of the request

cancellable

optional Gio.Cancellable object, null to ignore

callback

a Gio.AsyncReadyCallback to call when the request is satisfied