mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-04 18:26:19 +01:00
Merge branch 'non-atomicity-of-g_file_set_contents' into 'master'
gfileutils: document non-atomicity of g_file_set_contents() See merge request GNOME/glib!118
This commit is contained in:
commit
dd51b05e19
@ -1173,6 +1173,17 @@ write_to_temp_file (const gchar *contents,
|
|||||||
* lists, metadata etc. may be lost. If @filename is a symbolic link,
|
* lists, metadata etc. may be lost. If @filename is a symbolic link,
|
||||||
* the link itself will be replaced, not the linked file.
|
* the link itself will be replaced, not the linked file.
|
||||||
*
|
*
|
||||||
|
* - On UNIX, if @filename already exists and is non-empty, and if the system
|
||||||
|
* supports it (via a journalling filesystem or equivalent), the fsync()
|
||||||
|
* call (or equivalent) will be used to ensure atomic replacement: @filename
|
||||||
|
* will contain either its old contents or @contents, even in the face of
|
||||||
|
* system power loss, the disk being unsafely removed, etc.
|
||||||
|
*
|
||||||
|
* - On UNIX, if @filename does not already exist or is empty, there is a
|
||||||
|
* possibility that system power loss etc. after calling this function will
|
||||||
|
* leave @filename empty or full of NUL bytes, depending on the underlying
|
||||||
|
* filesystem.
|
||||||
|
*
|
||||||
* - On Windows renaming a file will not remove an existing file with the
|
* - On Windows renaming a file will not remove an existing file with the
|
||||||
* new name, so on Windows there is a race condition between the existing
|
* new name, so on Windows there is a race condition between the existing
|
||||||
* file being removed and the temporary file being renamed.
|
* file being removed and the temporary file being renamed.
|
||||||
|
Loading…
Reference in New Issue
Block a user