:right-sidebar: True FileSetContentsFlags =================================================================== .. currentmodule:: gi.repository.GLib .. versionadded:: 2.66 .. class:: FileSetContentsFlags :no-contents-entry: Flags to pass to :func:`~gi.repository.GLib.file_set_contents_full` to affect its safety and performance. Fields ------ .. rst-class:: interim-class .. class:: FileSetContentsFlags :no-index: .. attribute:: CONSISTENT Guarantee file consistency: after a crash, either the old version of the file or the new version of the file will be available, but not a mixture. On Unix systems this equates to an ``fsync()`` on the file and use of an atomic ``rename()`` of the new version of the file over the old. .. attribute:: DURABLE Guarantee file durability: after a crash, the new version of the file will be available. On Unix systems this equates to an ``fsync()`` on the file (if :const:`~gi.repository.GLib.FileSetContentsFlags.CONSISTENT` is unset), or the effects of :const:`~gi.repository.GLib.FileSetContentsFlags.CONSISTENT` plus an ``fsync()`` on the directory containing the file after calling ``rename()``. .. attribute:: NONE No guarantees about file consistency or durability. The most dangerous setting, which is slightly faster than other settings. .. attribute:: ONLY_EXISTING Only apply consistency and durability guarantees if the file already exists. This may speed up file operations if the file doesn’t currently exist, but may result in a corrupted version of the new file if the system crashes while writing it.