/* gcc `pkg-config --cflags --libs gio-2.0` test.c -o test */ #include int main (int argc, char *argv[]) { g_type_init (); char *text = "Text é"; GFile *file = g_file_new_for_path ("./test.txt"); g_file_replace_contents (file, text, -1, NULL, FALSE, 0, NULL, NULL, NULL); //g_file_set_contents ("test.txt", text, -1, NULL); // Works fine return 0; }