Pipe behavior
Randall R Schulz
rrschulz@cris.com
Fri Apr 4 00:54:00 GMT 2003
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/
More information about the Cygwin
mailing list