Is there any mechanism to remove garbage values from the pipe or FIFO.
As we are reading from pipe/FIFO there are some garbage value along with the desired result.
And in FIFO the behaviour is unexpected, as sometime the it read the exact values, sometime some garbage
i dont know if we have special command to flush FIFO.bt what i believe is that if we read all the information in FIFO then there will be nothing inside the fifo.si it will be flushed.
FIFO max size is 4096 defined in PIPE_BUF.if we make a loop in our pgm so that it reads all the characters till PIPE_BUF then it may work as flushing FIFO contents.
I hope my suggestion might help you.guide me if i m wrong