<div dir="ltr">Hi,<div><br></div><div>after some time spent debugging</div><div><br></div><div><a href="https://github.com/geany/geany/issues/605">https://github.com/geany/geany/issues/605</a><br></div><div><br></div><div>I think the file saving options are a bit confusing and misleading and should be simplified.</div><div><br></div><div>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.</div><div><br></div><div>2. It is now possible to set</div><div><br></div><div>use_gio_unsafe_file_saving=true</div><div>use_atomic_file_saving=true</div><div><br></div><div>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).</div><div><br></div><div>3. The fallback "ordinary" file saving when</div><div><br></div><div><div>use_gio_unsafe_file_saving=false</div><div>use_atomic_file_saving=false</div></div><div><br></div><div>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</div><div><br></div><div><a href="https://github.com/GNOME/glib/blob/master/gio/glocalfileoutputstream.c#L734">https://github.com/GNOME/glib/blob/master/gio/glocalfileoutputstream.c#L734</a><br></div><div><br></div><div><br></div><div>I would suggest removing the file saving option mentioned in (3) above and have just a single settings option like</div><div><br></div><div>use_gio_file_operations</div><div><br></div><div>Opinions?</div><div><br></div><div>Cheers,</div><div><br></div><div>Jiri</div><div><br></div></div>