This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Pipe behavior


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



Steven Kilby
Lead, Programmer Analyst
Vision Solutions, Inc.

17911 Von Karman Ave,  5th Floor
Irvine, CA 92614
UNITED STATES

Tel: +1 (949) 660-7479
Fax: +1 (949) 225-0287
Email: skilby at visionsolutions dot com
<http://www.visionsolutions.com/>
Disclaimer - 4/3/2003
The contents of this e-mail (and any attachments) are confidential, may be privileged, and may contain copyright material of Vision Solutions, Inc. or third parties. You may only reproduce or distribute the material if you are expressly authorized by Vision Solutions to do so. If you are not the intended recipient, any use, disclosure or copying of this e-mail (and any attachments) is unauthorized. If you have received this e-mail in error, please immediately delete it and any copies of it from your system and notify us via e-mail at helpdesk at visionsolutions dot com 
-----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/



--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]