Skip to content

Instantly share code, notes, and snippets.

@jedisct1
Created July 21, 2012 01:50
Show Gist options
  • Save jedisct1/3154219 to your computer and use it in GitHub Desktop.
Save jedisct1/3154219 to your computer and use it in GitHub Desktop.
Yay, glibc!
// C libraries print the file size.
// well, except glibc, that always prints 0.
#include <stdio.h>
int main(void)
{
FILE *fp = fopen("/tmp/aaa", "a+");
printf("%ld\n", ftell(fp));
fputc('x', fp);
fclose(fp);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment