是否有办法在没有产出缓冲的情况下管理军舰?
例如,
什么是使任何指挥的产出不受影响的一般性解决办法?
是否有办法在没有产出缓冲的情况下管理军舰?
例如,
什么是使任何指挥的产出不受影响的一般性解决办法?
AFAIK,你可以不cks。 书写管道(或从管道读取)会自动转而全面缓冲,而你无法做到这一点: 只有在阅读/写一个终点站时才能使用“Line缓冲”(这是你想要的)。 令人 The笑皆是: 他们把一项方案与假肢连接起来,以便管道的其他工具能够按照直线缓冲方式从该终端读/做成。 整个问题在此阐述:
该网页还提出一些建议(上述“ug”),即使用<代码>unbuffer<>/code>。 或用<代码>LD_PRELOAD pull。
Try stdbuf
, 包括在全球宇宙航行联合会的核心用途中,从而实际上也包含着任何持久性有机污染物的分解。 这使投入、产出和错误的缓冲长度达到零:
stdbuf -i0 -o0 -e0 command
The command unbuffer
from the expect
package disables the output buffering:
Ubuntu Manpage: unbuffer - unbuffer output
例常使用:
unbuffer hexdump file | ./my_script
也可使用<条码>。 指示将<代码>hexdump-buffered>(hexdump
)的输出推到一个假终点站,该终点站将trick到hexdump<>/code>,将其排入终端而不是管道。
# cf. http://unix.stackexchange.com/questions/25372/turn-off-buffering-in-pipe/
stty -echo -onlcr
script -q /dev/null hexdump file | ./my_script # FreeBSD, Mac OS X
script -q -c "hexdump file" /dev/null | ./my_script # Linux
stty echo onlcr
我们应当利用微粒或细微的“有线的”选择来解决这一问题。 不需要其他工具。
Right now, I have a console application I m working on, which is supposed to display and update information to the console at a given interval. The problem I m having is that with a carriage return, I ...
I am running array jobs with Sun Grid Engine (SGE). My carefully scripted array job workers generate no stdout and no stderr when they function properly. Unfortunately, SGE insists on creating an ...
I m very new to programming so I apologize in advance if my question is too silly. #!/usr/bin/python2.6 import subprocess, time p=subprocess.Popen([ cat ], stdin=subprocess.PIPE, stdout=...
#include <stdio.h> int main() { printf("This goes to screen "); freopen("out.txt", "a", stdout); printf("This goes to out.txt"); freopen("/dev/stdout", "a", stdout); printf(...
I have a cross-platform Perl program that starts a win32 windows program on win, and a macosx appliaction on the mac. I use system(), which on the mac makes the stdout of the invoked program, be ...
I m using Python (and the Win32 extensions) to execute macros in an Excel spreadsheet via the COM interface, as shown below: import win32com.client o = win32com.client.Dispatch("Excel.Application") o....
I m looking for a way in C to programmatically (ie, not using redirection from the command line) implement tee functionality such that my stdout goes to both stdout and a log file. This needs to ...
I try to log all the output of a program written in Python and C. However, printing from Python causes IOError: [Errno 9] Bad file descriptor Please, does anyone know what the problem is and how to ...