[racket] Why does this hang (reading subprocess stdout)?

From: Thomas Chust (chust at web.de)
Date: Sat Sep 24 23:20:57 EDT 2011

2011/9/25 Nadeem Abdul Hamid <nadeem at acm.org>:
> [...]
> This hangs even with the printf("Hello World\n") outputting a newline.
> But if I add fflush(stdout); in the C program after the printf it
> works.
> [...]


the default buffering behaviour of the C stdio functions usually
depends on whether output goes to a terminal or somewhere else.
Terminal output is usually line buffered while other output is usually
block buffered, so the observed behaviour is not really surprising.


When C++ is your hammer, every problem looks like your thumb.

Posted on the users mailing list.