AtomicFile


Object Hierarchy:

Object hierarchy for AtomicFile

Description:

public class AtomicFile : Object

Atomic file update helper.

AtomicFile writes data by replacing file contents in a single step, reducing risk of partial writes and corrupted configuration files. Optional backup support keeps previous contents before replacement.

Example:

    var configured = new AtomicFile ()
.withBackup (true)
.backupSuffix (".bak");
assert (configured.isOk ());
var atomic = configured.unwrap ();

bool ok = atomic.write (new Path ("/tmp/app.conf"), "port=8080\n");


Namespace: Vala.Io
Package: Valacore

Content:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class GLib.Object