From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: asynchronous process management on WinWP; buffering problem? Date: Fri, 14 Apr 2006 21:11:39 +0200 Message-ID: <443FF3EB.7020208@student.lu.se> References: <10m877fael0h3.1kg7y6ljn4qmb$.dlg@40tude.net> <443fdf5c$1@kcnews01> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1145041936 24595 80.91.229.2 (14 Apr 2006 19:12:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 Apr 2006 19:12:16 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 14 21:12:15 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FUTiI-0004eB-OQ for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Apr 2006 21:12:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FUTiI-0001j6-1S for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Apr 2006 15:12:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FUTi3-0001hA-4R for help-gnu-emacs@gnu.org; Fri, 14 Apr 2006 15:11:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FUTi1-0001fO-MP for help-gnu-emacs@gnu.org; Fri, 14 Apr 2006 15:11:58 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FUTi1-0001f9-Gt for help-gnu-emacs@gnu.org; Fri, 14 Apr 2006 15:11:57 -0400 Original-Received: from [81.228.8.164] (helo=pne-smtpout2-sn2.hy.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FUTi3-0005dH-LF for help-gnu-emacs@gnu.org; Fri, 14 Apr 2006 15:11:59 -0400 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout2-sn2.hy.skanova.net (7.2.070) id 4430FC02002C85DA; Fri, 14 Apr 2006 21:11:39 +0200 User-Agent: Thunderbird 1.5 (Windows/20051201) Original-To: kgold In-Reply-To: <443fdf5c$1@kcnews01> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:34367 Archived-At: 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 in >> DOS 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: if >> I send many "\n"-s (to "generate" a lot of prompts (to fill up the >> buffer?)) 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 I >> could handle this through filter functions, but...