File.replaceContentsAsync

Starts an asynchronous replacement of file with the given contents of length bytes. etag will replace the document's current entity tag. When this operation has completed, callback will be called with user_user data, and the operation can be finalized with g_file_replace_contents_finish(). If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If make_backup is TRUE, this function will attempt to make a backup of file.

Parameters

contents string

string of contents to replace the file with. [element-type guint8][array length=length]

length gsize

the length of contents in bytes.

etag string

a new entity tag for the file, or NULL. [allow-none]

makeBackup int

TRUE if a backup should be created.

flags GFileCreateFlags

a set of GFileCreateFlags.

cancellable Cancellable

optional GCancellable object, NULL to ignore.

callback GAsyncReadyCallback

a GAsyncReadyCallback to call when the request is satisfied

userData void*

the data to pass to callback function

Meta