FIFOS in C

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zeny
    New Member
    • Jul 2006
    • 44

    #1

    FIFOS in C

    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
Working...