home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / comm / netutils.lha / NetUtilities / source / inform.c next >
C/C++ Source or Header  |  1993-04-05  |  562b  |  32 lines

  1.  
  2. #include <stdio.h>
  3. #include <libraries/dos.h>
  4.  
  5. #define INF_PKT "ram:inform.pkt"
  6. #define CMD_PKT "ram:command.pkt"
  7.  
  8. void main(void) {
  9.   FILE *file=0;
  10.   char buf[256];
  11.  
  12.   for(;;) {
  13.     chkabort();
  14.     Delay(75);
  15.  
  16.     if (access(INF_PKT, 0) == 0) {
  17.       DisplayBeep(NULL);
  18.       remove(INF_PKT);
  19.     }
  20.  
  21.     if (access(CMD_PKT, 4) == 0) {
  22.       if (file = fopen(CMD_PKT, "r")) {
  23.         fgets(buf, sizeof(buf), file);
  24.         Execute(buf,0,0);
  25.         fclose(file);
  26.         file=0;
  27.         remove(CMD_PKT);
  28.       } else puts("File execution error\n");
  29.     }
  30.   }
  31. }
  32.