Rust Line Writer and Fifo pipe bug?

I found I had a problem writing from a LineWriter to a Fifo pipe being consumed by another process. Buffering on the LineWriter greater than the pipe capacity caused dropped data--even when doing a flush after each write.

Lowering the buffer size to < the pipe size fixed it...as well as just using a File to write.

Is there a potential bug in LineWriter with regard to flush?

I asked the same thing xD

Hmm maybe its not exactly similar, but itcould be related

So basicly my understanding is:

  • you cant write more than pipe size at once

The solution is to write less then pipe size and to make sure the receving process continuly read from the pipe inorder to clear it for the next write

Basically -- The solution is to write less then pipe size. The consuming on the other end is just normal Linux operations assumed.

But you mentioned data drop ,not blocking when excceding pipe size, I would speculate that the consumer is overwriting the data somehow

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.