filesize.c 381 B

1234567891011121314151617181920
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /* $Id$ */
  6. #include <sys/types.h>
  7. #include <sys/stat.h>
  8. #include "system.h"
  9. long
  10. sys_filesize(path)
  11. char *path;
  12. {
  13. struct stat st_buf;
  14. if (stat(path, &st_buf) != 0)
  15. return -1L;
  16. return (long) st_buf.st_size;
  17. }