<p></p>
<blockquote>
<p>To be clear, running out of disk part way through writing the file is a hardware problem. Your hardware doesn't have a big enough disk :)</p>
</blockquote>
<p>I don't agree with you...</p>
<p>I did some tests in a VM with geany and some other editors and the same situation. Here are the results:</p>
<ul>
<li>geany => nulls out the original file</li>
<li>xfw (from xfe file manager) => nulls out the original file</li>
<li>mousepad => truncates the original file</li>
<li>kate => truncates the original file</li>
<li>gedit => preserves the original file</li>
</ul>
<p>So, as you see there are differences between the editor implementations. Among the five tested editors, gedit does the best job. It warns that the partition is full and it doesn't change the original file.</p>
<p>Why not doing the same as gedit? I think gedit relies on gio operations...</p>
<p>Another point: you could check the available space using statvfs() before attempting to save the file. I think you said this way is not accurate, why?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/2494#issuecomment-625697225">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ5GMHQHPQ2RNIDSRWTRQO46PANCNFSM4M3C37ZQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAIOWJ4CPNMQDBPZU256L63RQO46PA5CNFSM4M3C37Z2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEVFWDSI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/2494#issuecomment-625697225",
"url": "https://github.com/geany/geany/issues/2494#issuecomment-625697225",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>