On Mon, 19 Jan 2009 19:18:00 +0100, Enrico wrote: >On Mon, 19 Jan 2009 19:05:51 +0100, Jelle de Jong ><jelledej...@powercraft.nl> wrote: > >>>> Today I got an other disappointed experience with Geany. I was >>>> working on some large bash program while I run out of disk space >>>> due to some test converting script running in the background. >>>> >>>> I hit the save button of the script I was working on and the script >>>> was over written to a 0 (zero) size document losing the complete >>>> document. Geany should stop doing this, and should not write to the >>>> file when there is no space! >>> >>> The user should take care of his system and the disk space. >>> Anyway, I definitely will fix the issue that configuration files >>> will get lost when there is no disk space available sometime this >>> week. And probably also for normal documents files (though I'm >>> still not convinced of the need of this). >>> >>>> I had to investigate my complete hard disk and memory to recover >>>> some >>> >>> You should investigate your shell script which ate all of your >>> available disk space. This is the real bug, IMO. >>> >>> (SCNR) >>> >>> Regards, >>> Enrico >>> >> >>Hi Enrico, >> >>You are right the user should take care of his disk space. The script >>that run was not really to blame, it generated 2GB raw scanned images >>on >> a 4 GB disk, warning of no more disk space came up but was to late. >> But >>this is not the problem behind losing the working files that geany had >>opened. >> >>Geany should provide a fail to save error and catch the exception. It >>should then not renew the displayed contained of the file. But should >>let the user provide an other place to store the file. This way the >>current work will not be lost. > >Yup, will post an update here when things changed.
Unfortunately, I forgot to update on changes, so let's do it now: Since Geany 0.16, the configuration directory problems should be gone. Since Geany 0.17, there is a hidden preference to enable saving *all* files, config files as well as edited documents, using the g_file_set_contents (). This means, the contents are written to a temporary file first, and if this was successful the temporary file will be moved to the target file (as both files are in the same directory, it's like renaming the temp file). As already pointed out, this has several implications on the target file like loosing file permissions and destroying hardlinks. And so this is disabled by default. More information about this can be found in the GLib API docs, see http://library.gnome.org/devel/glib/stable/glib-File-Utilities.html#g-file-set-contents. If you like to enable this way of writing files, edit the file ~/.config/geany/geany.conf and set the value of "use_safe_file_saving" to "true" (without the quotes, of course). More information about setting hidden preferences and the "use_safe_file_saving" preference in particular can be found on http://www.geany.org/manual/current/index.html#hidden-preferences. This should be enough to close this bug. Regards, Enrico -- Get my GPG key from http://www.uvena.de/pub.asc
pgpzGDLghDrhZ.pgp
Description: PGP signature