home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 125.img / PRO-C4.ZIP / BENCH1.ZIP / HELP / HELPMISC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-28  |  1.2 KB  |  65 lines

  1. /* ==( bench/helpmisc.c )== */
  2. /* ----------------------------------------------- */
  3. /* Pro-C  Copyright (C) 1988 - 1990 Vestronix Inc. */
  4. /* Modification to this source is not supported    */
  5. /* by Vestronix Inc.                               */
  6. /*            All Rights Reserved                  */
  7. /* ----------------------------------------------- */
  8. /* Written   RN   15-Jan-90                        */
  9. /* ----------------------------------------------- */
  10. /* %W%  (%H% %T%) */
  11.  
  12. /*
  13.  *  Modifications
  14.  *
  15. */
  16.  
  17. # include <stdio.h>
  18. # include <bench.h>
  19. # include <fileio.h>
  20. # include <errno.h>
  21.  
  22. # include "help.h"
  23.  
  24. # ifdef ANSI
  25. long fsize(int);
  26. void stripext(char *);
  27. # else
  28. long fsize();
  29. void stripext();
  30. # endif
  31.  
  32. long fsize(fd)
  33.     int fd;
  34. {
  35.     long file_length;
  36.  
  37.     file_length = lseek(fd, 0L, SEEK_END);
  38.  
  39.     return(file_length);
  40.  
  41. /*
  42.     struct stat sbuf;
  43.  
  44.     if (FSTAT(fd, &sbuf) == -1)
  45.     {
  46.         errmsg("fsize() : Error getting status on index file (%d)", errno);
  47.         return(-1L);
  48.     }
  49.     return(sbuf.st_size);
  50. */
  51. }
  52.  
  53. long file_time(path)
  54.     char *path;
  55. {
  56.     struct stat sbuf;
  57.  
  58.     if (STAT(path, &sbuf) == -1)
  59.     {
  60.         errmsg("fsize() : Error getting status on index file (%d)", errno);
  61.         return(-1L);
  62.     }
  63.     return(sbuf.st_mtime);
  64. }
  65.