GFile *file; gchar *contents; gchar **lines; int i; file = g_file_new_for_path ("test_file"); if (!g_file_load_contents (file, NULL, &contents, NULL, NULL, NULL)) return; lines = g_strsplit (contents, "\n", 0); g_free (contents); for (i = 0; lines[i] != NULL; i++) { g_message (lines[i]); } g_strfreev (lines);
howto use g_file_load_contents
猜你喜欢
转载自socol.iteye.com/blog/1152686
今日推荐
周排行