I don't think the it will work.
She'll works that way because the FILE stream stdout is line buffered since it is with terminal. Simply cloning file no. through dup2 will not change the behavior of buffering on the stream.[/quote]
你说的是对的。 但是你没有办法改变 已有软件的输出缓存机制 了 ,so 这个问题 没有答案。
[/quote]
yes or no, we have no idea what the source looks like.
say, popen is used, then you will have a file no. Can we change the default buffer behavior from full buffer to line buffer using setbuf against this file stream?
I don't think the it will work.
She'll works that way because the FILE stream stdout is line buffered since it is with terminal. Simply cloning file no. through dup2 will not change the behavior of buffering on the stream.[/quote]
你说的是对的。 但是你没有办法改变 已有软件的输出缓存机制 了 ,so 这个问题 没有答案。
I don't think the it will work.
She'll works that way because the FILE stream stdout is line buffered since it is with terminal. Simply cloning file no. through dup2 will not change the behavior of buffering on the stream.