[Geany-devel] Safe file saving

Enrico Tröger enrico.troeger at xxxxx
Thu Feb 4 21:06:08 UTC 2010

On Wed, 03 Feb 2010 21:03:12 +0300, Алексей wrote:

>I have recently faced a problem when Geany seemed to corrupt my files
>over GVFS. The issues were as follows:
> 1. Saving a modified text file (removing 1 line) over Samba
> (gvfsd-smb):
>    - geany: makes a mess at the end of file
>    - gedit: all OK
> 2. Saving a modified text file over SFTP (gvfsd-sftp):
>    - geany: makes a file empty (0 bytes), e.g. all content is lost
>    - gedit: all OK
>It seems that this bug is more GVFS-related than Geany's ('cause
>low-level utils like cat and echo also have some strange behaviour,
>which is not reproducible over shares mounted with mount.cifs), so I'm
>going to file these to GVFS bug tracker. But it also seems that
>g_file_set_contents works OK. I have found out that Geany is able to
>use g_file_set_contents (with use_save_file_saving=true), but on local
>files only. So I suggest:
> 1. Patching src/document.c to allow g_file_set_contents on both local
> and remote files:

That's probably ok.
IIRC the main reason why I disabled g_file_set_contents() for remote
files was that GVfs does for remote files the same thing the option in
Geany provides: first saving to a temporary file and then move the
temporary file to the target file. I didn't assume g_file_set_contents
would make any difference for remote files.
OTOH I know that the GVfs-Fuse backend isn't that stable and has lots
of bugs, especially with some FTP servers.
If there are no objections, I'll apply the patch soon.

> 2. (Possibly, but not necessarily) make this option
> (use_save_file_saving) accessible through the GUI

I think this would cause mainly just confusion. It just isn't that easy
to explain what's the story behind this option. No idea.


Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100204/df42a069/attachment.pgp>

More information about the Devel mailing list