[glib] gfile: Clarify that g_file_replace_contents() uses atomic renames



commit 4b02bfd6eee43aaaa0ad30955cc85558f402d90f
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Wed Jun 17 09:25:49 2015 +0100

    gfile: Clarify that g_file_replace_contents() uses atomic renames
    
    It uses g_file_replace() internally, so is inherently safe.
    
    Though it might vomit .goutputstream-XXXXXX files all over the place
    occasionally.

 gio/gfile.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gio/gfile.c b/gio/gfile.c
index 8925215..0fd62f2 100644
--- a/gio/gfile.c
+++ b/gio/gfile.c
@@ -7132,7 +7132,9 @@ g_file_load_contents_finish (GFile         *file,
  * or the error %G_IO_ERROR_WRONG_ETAG will be returned.
  *
  * If @make_backup is %TRUE, this function will attempt to make a backup
- * of @file.
+ * of @file. Internally, it uses g_file_replace(), so will try to replace the
+ * file contents in the safest way possible. For example, atomic renames are
+ * used when replacing local files’ contents.
  *
  * If @cancellable is not %NULL, then the operation can be cancelled by
  * triggering the cancellable object from another thread. If the operation


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]