GNOME Bugzilla – Bug 566231
Ther's no way to write a GKeyFile to a file in the GLib API
Last modified: 2009-01-02 23:25:38 UTC
According to the documentation, there's no way to directly write back a GKeyFile to its/another file. The only way seems now to write a custom function using g_key_file_to_data() and such as g_file_set_contents(). I think writing a GKeyFile to a file is common enough to consider adding a simple g_key_file_to_file() or such function directly in the GLib. Moreover, there's a function to load a configuration directly from a file, I think it would be more consistent to have a function to do the opposite. I'll attach a small patch (based on 2.16.6) with a naive but functional implementation. Regards, Colomban W.
Created attachment 125601 [details] [review] Small patch implementing naive writing file capabilities to GKeyFile This patch is build against GLib 2.16.6 (Debian Lenny).
*** This bug has been marked as a duplicate of 309224 ***