0

I have one program writing to mkfifo created device 7 lines of text data every 3 seconds using printf(). I am trying to read it with cat /path/to/device in another terminal window. But instead of updating every 3 seconds, it will print something only once every 25 seconds. Why? How to make it update faster? (Ubuntu Wily)

exebook
  • 32,014
  • 33
  • 141
  • 226

1 Answers1

1

One or both ends of the pipe is buffering more than you want. In your writing program, fflush when you finish writing your 7 lines, and read the output with cat -u (if your cat is not GNU cat).

Toby Speight
  • 27,591
  • 48
  • 66
  • 103