Does anyone know how to empty a fifo(named pipe) after a read?
if (mkfifo(fifo_di rectory,0777)==-1) perror("Error") ;
desc= open(fifo_direc tory,O_RDONLY);
if (desc==-1) perror("Error") ;
char* message= malloc(PIPE_BUF *sizeof(char));
while(1) {
read(descritor, mensagem,PIPE_B UF);
//here i would like to empty the pipe
}
Best regards
if (mkfifo(fifo_di rectory,0777)==-1) perror("Error") ;
desc= open(fifo_direc tory,O_RDONLY);
if (desc==-1) perror("Error") ;
char* message= malloc(PIPE_BUF *sizeof(char));
while(1) {
read(descritor, mensagem,PIPE_B UF);
//here i would like to empty the pipe
}
Best regards