How fo force subprocess to refresh stdout buffer?
Asked Answered
F

0

6

Platform: windows 8.1 IDE: vs2013 use c/c++

Process A read stdout of subprocess using pipe redirect.

but subprocess dont invoke fflush after printf, so processs A cant read anything from pipe before subprocess run to end.

ps: I have souce code of subprecess, but its very hard to modify them.

So whether Process A can force subprocess refresh stdout buffer to read something before subprocess run to end? (the same effective as fflush)

Flaggy answered 20/3, 2014 at 8:12 Comment(2)
related: Python C program subprocess hangs at “for line in iter”Alic
Very helpful. Thx.Flaggy

© 2022 - 2024 — McMap. All rights reserved.