home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / pmake2.lbr / GETMOD.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-16  |  768 b   |  31 lines

  1. /* getmod -- pmake function to determine if a file has been modified        */
  2. /* copyright 1984  Michael M Rubenstein                                     */
  3.  
  4. #include <stdio.h>
  5. #include <fcb.h>
  6. #include "pmake.h"
  7.  
  8. getmod(name)
  9.   char                  *name;
  10. {
  11.   FCB                   fil;
  12.   static int            d;
  13.   static unsigned       user;
  14.  
  15.   extern unsigned       c_user;
  16.   extern int            modbit;
  17.  
  18.   if (*name == '.')
  19.     return NOTTHERE;
  20.   setfcb(&fil, name);
  21.   user = getusr();
  22.   setusr(c_user);
  23.   d = open(&fil);
  24.   setusr(user);
  25.   if (d == 0xff)
  26.     return NOTTHERE;
  27.   d = (fil.name1.fname[modbit] & 0x80) ? UNCHANGED : CHANGED;
  28.   close(&fil);
  29.   return d;
  30. }
  31.