Skip to content

Instantly share code, notes, and snippets.

@yashi
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yashi/a00f33f38b5fcd7ab0bd to your computer and use it in GitHub Desktop.
Save yashi/a00f33f38b5fcd7ab0bd to your computer and use it in GitHub Desktop.
/* -*- compile-command: "gcc -Wall -Wextra -g $(pkg-config --cflags --libs gio-2.0) transfer-full-out.c" -*- */
#include <gio/gio.h>
#include <stdio.h>
int main()
{
GFile *file;
char *buf;
gsize len;
file = g_file_new_for_path("/etc/passwd");
g_file_load_contents(file, NULL, &buf, &len, NULL, NULL);
fwrite(buf, len, 1, stdout);
g_free(buf);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment