|
From: | Lennart Borgman |
Subject: | Re: asynchronous process management on WinWP; buffering problem? |
Date: | Fri, 14 Apr 2006 21:11:39 +0200 |
User-agent: | Thunderbird 1.5 (Windows/20051201) |
I do not understand this so I have some (perhaps stupid) questions: - What determines how the buffering works? - Can a program like Emacs change this behaviour?- When does the buffering works differently? In a "console"? Is cmd.exe a "console"? But is it not just another program?
kgold wrote:
The output buffering is a common problem. For C and perhaps other languages, stdout is normally line buffered. But when you pipe the output (like through emacs) it becomes fully buffered. So you don't see the output until the buffer is full.I don't know if there's a general solution. If it's C and you have the source, this will fix it.setvbuf(stdout, _IONBF, 0); Peter Tury wrote:I try to control program xxx on MS WinXP from EmacsW32 (cvs). xxx runs inDOS window normally and after a command it reads from stdin (until newline), handles the input and, after another command, writes result to stdout. However it seems that some buffering (in Emacs? in MS Windows'stdin/stdout?) tries to kill me: I can't see the results (from stdout) in the associated buffer, only if it is long enough. At least it seems so: ifI send many "\n"-s (to "generate" a lot of prompts (to fill up thebuffer?)) then I get everything together after a while (of course, if I run the program normally (=in a DOS window) everything works fine)... I hope Icould handle this through filter functions, but...
[Prev in Thread] | Current Thread | [Next in Thread] |