file_replace_contents


Description:


[ Version ( since = "1.2" ) ]
public Future file_replace_contents (File file, uint8[] contents, string? etag, bool make_backup, FileCreateFlags flags)

Wraps [method@Gio.

File.replace_contents_async].

This function copies contents into a [struct@GLib.Bytes] so the caller does not need to keep the buffer alive for the duration of the operation.

Parameters:

file

a [iface@Gio.File]

contents

the contents to write

etag

the etag or null

make_backup

if a backup file should be created

flags

a set of [flags@Gio.FileCreateFlags]

length

the length of contents

Returns:

a [class@Dex.Future] which resolves to the new etag, or null if no etag is available.


Namespace: Dex
Package: libdex-1