<blockquote>
<p>but using a known buggy GIO</p>
</blockquote>

<p><a href="https://bugzilla.gnome.org/show_bug.cgi?id=602412">https://bugzilla.gnome.org/show_bug.cgi?id=602412</a>  Added to <a href="https://github.com/elextr" class="user-mention">@elextr</a>'s thesis for reference.  This is the real annoyance here, because we <em>know</em> it fails miserably in that case.</p>

<p>However, I'm not really sure it's actually worse than plain write, as the only disadvantage over it would be speed on <em>some</em> scenarios.  The <code>use_atomic_file_saving</code> (<code>g_file_set_contents()</code>) has other safety advantages, but is too problematic on losing permissions.<br>
So maybe it'd be good enough to only keep the default way, and really use it to it's full potential.  Yet IIRC we had issues with this, and a comment in the code says:</p>

<blockquote>
<p>It is best in most GVFS setups but don't seem to work correctly on some more complex setups (saving from some VM to their host, over some SMB shares, etc.)</p>
</blockquote>

<p>So we'd still have to be careful.</p>

<p>But I generally agree with you that we'd be happier with a single saving method using GIO, which is supposed to handle all the boring details for us.  Unfortunately, it's not as pretty as that…</p>

<p>However, maybe we could implement a halfway solution in the meantime, using the full GIO potential when using <code>g_file_replace_contents()</code> (the default), and fallback to failing on non-local mounts if another method is selected.  I'm not quite sure of what code changes that would mean, but that might be possible and the least "dangerous" option (e.g. keep all the complexity we have for all weird cases, yet default to fully supporting GFVS).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany/issues/921#issuecomment-193205790">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ1QZ1-kWjP9ibnp7WKQYwENwDq5pks5prAW-gaJpZM4HktYA.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/921#issuecomment-193205790"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>