<br><br><div class="gmail_quote">On Tue, Nov 15, 2011 at 10:04 AM, Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca">feeley@iro.umontreal.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On 2011-11-14, at 8:40 PM, Meng Zhang wrote:<br>
<br>
> >> Below are code I wrote to reproduce the problem<br>
> >><br>
> >> (with-output-to-process<br>
> >>   (list path: "sed"<br>
> >>         arguments: '("-e" "s/n/N/g"))<br>
> >>   (lambda ()<br>
> >>     (display "nothing")))<br>
> >><br>
><br>
> Actually, I can't get your example to run without an error on v4.6.2 .  Can I ask you what you expected your code to do?<br>
> This problem happened in 4.6.1, not 4.6.2<br>
<br>
</div>I understand.  But you said that once you upgraded to v4.6.2 the problem went away.  But when I try with v4.6.2 I get the same result as v4.6.1 on the code above.  So I am wondering why there is a difference on v4.6.2.<br>

<div class="im"><br>
> It is sending the text "nothing" to sed's input.  Are you expecting the output of sed to appear on the terminal?<br>
><br>
> The procedure with-output-to-process gives to sed a *closed* file descriptor for its stdout.  This is why sed complains ("sed: stdout: Broken pipe").  If you didn't want this, you can give an stdout-redirection: #f setting and sed's stdout will be the same as the interpreter's stdout (usually the terminal):<br>

> In 4.6.1, when I run the code above, the current thread sleeps forever.(since the stack frame is at "thread-sleep!")<br>
<br>
</div>What happens when you try the code below?<br>
<div class="im"><br>
> (with-output-to-process<br>
>  (list path: "sed"<br>
>        arguments: '("-e" "s/n/N/g")<br>
>        stdout-redirection: #f)<br>
>  (lambda ()<br>
>    (display "nothing\n")))<br>
<br>
</div>Do you get the output on the screen?<br></blockquote><div>Yes, it prints "NothiNg" and then fall asleep without exiting.(in 4.6.1)</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<font color="#888888"><br>
Marc<br>
<br>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br>Zhang Meng<br>School of Software Engineering, Tongji University<br>MP: +86 151-2103-2798<br>