g_file_set_contents equivalent in libpurple?

William Ehlhardt williamehlhardt at gmail.com
Sun Jul 8 01:01:23 EDT 2007

In building the public-key certificate interface, I need to load and
store large binary blobs of data from and to files on disk (for
import/export functionality). For loading, g_file_get_contents meets
my need. For storing, purple_util_write_data_to_file is *almost*
ideal, but it is limited to files in ~/.purple, while I would like to
have access to any path in the filesystem.

g_file_set_contents [1] seems ideal for this purpose, but
unfortunately was introduced in glib 2.8, making it a
backwards-compatibility problem. How should I handle this? For now, I
have simply used g_file_set_contents [2].


[1] http://developer.gnome.org/doc/API/2.0/glib/glib-File-Utilities.html#id2841205
[2] Revision 38523a696849b1529681ae27bc5928cf6d9c85d6 on

More information about the Devel mailing list