C# : Redirect console application output : How to flush the output?

后端 未结 3 1231
遇见更好的自我
遇见更好的自我 2020-11-30 12:51

I am spawning external console application and use async output redirect.
as shown in this SO post

My problem is it seems that the spawned process needs to pro

3条回答
  •  难免孤独
    2020-11-30 13:32

    It seems as the problem was that the dummy app was written in c# which flushes the output automatically one every println while the 3rd party app was written in c/c++ and therefore only wrote when the stdoutbuffer was full. The only solution which ive found is to make sure the c/c++ app flushes after every print or to set its buffer to 0.

提交回复
热议问题