Advertisement
Guest User

fsize.c

a guest
Apr 3rd, 2020
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <assert.h>
  3. #include <sys/stat.h>
  4.  
  5. size_t fsize(const char *pn) {
  6.     struct stat statbuf;
  7.     assert(!stat(pn, &statbuf));
  8.     return statbuf.st_size;
  9. }
  10.  
  11. int main() {
  12.     printf("%I64u\n", fsize("fsize.c"));
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement