1

Possible Duplicate:
How can I get a file's size in C?

how do I know if binary file is empty in C?

Community
  • 1
  • 1
bla
  • 11
  • 2

1 Answers1

5
// assume file is opened as FILE *fp
fseek(fp, 0L, SEEK_END);
bool empty = ftell(fp) == 0L;
Fred Foo
  • 355,277
  • 75
  • 744
  • 836