home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / dino / dino_bot.1 / source / shell2 / newer2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-10  |  724 b   |  40 lines

  1. /* Copyright, 1990, Regents of the University of Colorado */
  2. #define BOOL char
  3. #define TRUE 1
  4. #define FALSE 0
  5. #define MAXNAMESIZE 128
  6.  
  7. #include <stdio.h>
  8. #include <sys/types.h>
  9. #include <sys/stat.h>
  10.  
  11. extern void exit();
  12.  
  13. int main(argc, argv)
  14.     int argc;
  15.     char *argv[];
  16.    {
  17.     struct stat buf1, buf2;
  18.  
  19.     if (argc < 3)
  20.        {
  21.         (void) fprintf(stderr, "Incorrect number of arguments to dinochk2.\n");
  22.         exit(1);
  23.        }
  24.  
  25.     if (stat(argv[1], &buf1) != 0)
  26.        {
  27.         (void) fprintf(stderr, "dinochk2 unable to access %s.\n", argv[1]);
  28.         exit(1);
  29.        }
  30.  
  31.     if (stat(argv[2], &buf2) != 0)
  32.         exit(1);
  33.  
  34.     if (buf1.st_mtime > buf2.st_mtime)
  35.             exit(1);
  36.  
  37.     return(0);
  38.    }
  39.  
  40.