1

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)

1
  • are you using concurrency with other shells scripts ?
    – deimus
    Commented Dec 7, 2015 at 13:47

1 Answer 1

2

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.