Hello,

Le 25/01/2013, Rudra Banerjee <rudra.baner...@aol.co.uk> a écrit :
> But is it so tough? database and all that?
For managing several bibliography files, that should be better yes.

> All I want to do is to have the ability of editing an existing file.
> Since directly editing the file is not recommended, this is the reason
> why I want to open it as buffer!
For just handling one file, that's not necessary of course.

The idea when you want to change a file on disk is (not too big) :
- generate a buffer of the full content of the file in memory, using
  GString for instance
  (http://developer.gnome.org/glib/unstable/glib-Strings.html) since
  they are automatically expending in size but can be used with
  equivalent printf() convenient functions ;
- copy atomicaly the buffer in the file with g-file-set-contents()
  
http://developer.gnome.org/glib/unstable/glib-File-Utilities.html#g-file-set-contents
- delete the buffer.

Damien.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to