Re: Forking - a few queries

From: George Greer (
Date: 01/10/00

On Mon, 10 Jan 2000, Julian Buckley wrote:

>Now, the code simply scans the syslog.* files (syslog.1, syslog.2, etc)
>for occurrences of 'SYSERR' and counts the number of lines

void syserr_check(struct char_data *ch)
  int count;
  FILE *pipeme;

  pipeme = popen("grep SYSERR ../log/syslog.* | wc -l", "r");
  fscanf(pipeme, "%d\n", &count);

>  if (count) {
>    sprintf(buf, "\007\007\007\007&rThere are %d SYSERRs in the system
>logs requiring attention.&n\r\n", count);
>    send_to_char(buf, ch);
>  }

Not sure how fast it'll run, but shouldn't be too bad since only one
integer is produced.

George Greer            | CircleMUD Snippets   |

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 04/10/01 PDT