delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/03/19:54:32

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-Id: <5.2.0.9.2.20030403165239.033d8da0@pop3.cris.com>
X-Sender: rrschulz AT pop3 DOT cris DOT com
Date: Thu, 03 Apr 2003 16:54:24 -0800
To: cygwin AT cygwin DOT com
From: Randall R Schulz <rrschulz AT cris DOT com>
Subject: RE: Pipe behavior
In-Reply-To: <D0720E03FE8450489330A332BDB176430102DD89@exchange.visionso
lutions.com>
Mime-Version: 1.0

Steven,

I assume the test program you're using to explore this behavior is 
pretty concise. Why don't you post it here?

Randall Schulz


At 16:44 2003-04-03, Steven Kilby wrote:
>Randall,
>
>Thanks for the response.  No, I am not sure that Emacs uses pipes
>instead of ptys.  I'll have to look at that.  I was testing with the
>cygwin character emacs.  What you said makes sense but I have one more
>question.  I modified the code by inserting a call to fflush between the
>printf's.  I would have thought this would force the first printf to
>display immediately but this did not happen.  Can you help me understand
>why?
>
>Thanks
>
>Steven
>
>>Original Message-----
>>From: Randall R Schulz [mailto:rrschulz AT cris DOT com]
>>Sent: Thursday, April 03, 2003 4:41 PM
>>To: cygwin AT cygwin DOT com
>>Subject: Re: Pipe behavior
>>
>>
>>Steven,
>>
>>At 16:28 2003-04-03, you wrote:
>> >Hello,
>> >
>> >I have a question about pipe behavior.  I wrote a simple program that
>> >does a printf, sleeps for 5 seconds and then another printf.  If I run
>> >the program with the following way:  $ ./simple | cat  The output is
>> >delayed until the program finished.  I guessed that the pipe is
>> >buffered and doesn't flush until it is closed when the program ends.
>> >But then I ran the same program as an emacs subprocess and attached a
>> >buffer to it. In this scenario the first printf is displayed, 5 seconds
>>
>> >pass and then the second printf is displayed.  Emacs also uses pipes so
>>
>> >I do not understand why the behavior is different.
>>
>>Pipes don't buffer in the manner you describe, but the standard I/O
>>library does when its output is directed to a pipe or a plain file.
>>
>>Are you sure that Emacs uses pipes and not ptys (pseudo-ttys)?
>>
>>Which Emacs are you using? Cygwin or Windows?
>>
>>
>> >Thanks
>> >Steven Kilby
>>
>>
>>Randall "We don't need no stinkin' disclaimers" Schulz


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019