FILE* fp = fopen("output",...)
fprintf(stdout, "This is just an example");
fprintf(fp, "This is just an example"..
写两遍不就行了。作者: zy116 时间: 2005-11-21 17:43
lz的意思,是不是要捕获屏幕输出啊,就好像做个监视屏幕的木马。
是吗?作者: yzc2002 时间: 2005-11-21 17:52
正好我也有类似的一个问题,shell没得到结果,这里不知道有没有人知道?
现在不改程序,有没有办法做到?作者: flw 时间: 2005-11-21 17:52
tee作者: yzc2002 时间: 2005-11-21 20:06
不行的,好象管道也有缓冲作者: 1jjk 时间: 2005-11-21 20:07
楼主?
难道你要实现传说中的vim?作者: ktdid 时间: 2005-11-21 21:26
5楼的,有缓冲你不会flush啊,不会设成不缓冲啊。
另外,man tee:
The tee utility copies standard input to standard output, making a copy
in zero or more files. The output is unbuffered.