Hi,
after some time spent debugging
I think the file saving options are a bit confusing and misleading and should be simplified.
1. Both g_file_set_contents() and g_file_replace_contents() do absolutely the same thing (saving to temporary file, then renaming the file), the only difference is the first uses POSIX calls while the second GIO. The use_gio_unsafe_file_saving name is very confusing because it's not unsafe in any way.
2. It is now possible to set
use_gio_unsafe_file_saving=true
use_atomic_file_saving=true
and to users it's unclear which of the options will be actually used (it's the use_atomic_file_saving case because it's checked first in the code).
3. The fallback "ordinary" file saving when
use_gio_unsafe_file_saving=false
use_atomic_file_saving=false
doesn't bring any benefit compared to the two above - it's similar to use_atomic_file_saving=true in using POSIX calls, it's just a bit less safe because it writes directly to the file without the renaming. The GIO g_file_replace_contents() recreates the file's permissions/ownership correctly in
I would suggest removing the file saving option mentioned in (3) above and have just a single settings option like
use_gio_file_operations
Opinions?
Cheers,
Jiri