1
0

filesize.c 322 B

1234567891011121314
  1. /* filesize.c - prints size of passwd file */
  2. #include <stdio.h>
  3. #include <sys/stat.h>
  4. int main()
  5. {
  6. struct stat infobuf; /* place to store info */
  7. if ( stat( "/etc/passwd", &infobuf) == -1 ) /* get info */
  8. perror("/etc/passwd");
  9. else
  10. printf(" The size of /etc/passwd is %d\n", infobuf.st_size );
  11. }