[Geany-devel] Safe file saving - permissions issue

Nick Treleaven nick.treleaven at xxxxx
Tue Apr 6 11:10:13 UTC 2010


On Sat, 03 Apr 2010 03:51:18 +0400
Алексей Антипов <1a_antipov at mail.ru> wrote:

> Please find the patch in attachment. When building with GIO, it would use g_file_replace_contents

I think this is a good idea (but haven't tested it as I don't have
GIO). However, I don't think we should change the meaning of the 'safe
file saving' pref. What if there's a bug in GIO? At least we know that
pref doesn't lose data.

We could maybe add a 'backup' Geany pref for GIO as this is probably
more efficient than the Save Actions plugin backup option.

P.S. Please don't top-post ;-)

> Fri, 02 Apr 2010 12:12:36 +0400 письмо от Алексей Антипов<1a_antipov at mail.ru>:
> 
> > Sure, it does not alter permissions.
> > 
> > I suppose that with make_backup=TRUE it would first (attempt to) copy previous file to a backup file,
> > and only then write a new one. The annoying thing is that it would not delete a backup file, and the
> > only way to get its name is to "guess" (usually for "filename" the backup name is "filename~").
> > Probably the backup file can be left as it is, so a user gets a copy of his/her old data; those who are
> > annoyed with that can simply turn the option off.
> > 
> > I've created a patch which requires some final testing; I'll send it today or tomorrow (can test only with smb:// and 
> > sftp://, 'cause have nothing else:))
> > 
> > Thu, 1 Apr 2010 17:07:59 +0100 письмо от Nick Treleaven <nick.treleaven at btinternet.com>:
> > 
> > > On Thu, 1 Apr 2010 12:41:13 +0100
> > > Nick Treleaven <nick.treleaven at btinternet.com> wrote:
> > > 
> > > > > Btw, the bugs with GVFS didn't appear with GNOME 2.26 (and probably before), so I think we can safely use fopen() and fprintf()/fwrite() there. Then, your proposal about version separation (use GIO with GLib>=2.16 and fopen()/g_file_set_contents() with other) is extremely attractive. Do you know if there is a way to get GLib version at runtime, not at compile-time (so that there is no need to rebuild all the packages for different versions)?
> > > > > 
> > > > > I'm going to start working on it; if this is OK, I'll send a patch ASAP.

Regards,
Nick



More information about the Devel mailing list