2022-02-25 23:51:40 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
char *line = NULL;
|
|
|
|
size_t len = 0;
|
|
|
|
while (1) {
|
|
|
|
FILE* controlFile = fopen("silencePipe.control", "r");
|
|
|
|
char silenceChar = getc(controlFile);
|
|
|
|
fclose(controlFile);
|
|
|
|
ssize_t lineSize = getline(&line, &len, stdin);
|
|
|
|
if (silenceChar!='1') {
|
|
|
|
printf("%s",line);
|
2022-02-28 22:55:23 +00:00
|
|
|
} else {
|
|
|
|
fprintf(stderr,"%s",line);
|
2022-02-25 23:51:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
free(line);
|
|
|
|
return 0;
|
|
|
|
}
|