<div dir="ltr">I tried to use your code but I don&#39;t have either class in my 4.3 or 4.4 images. Do they require adding something?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 17, 2013 at 1:38 PM, David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Jun 17, 2013 at 10:16:05AM -1000, OpenSlate ChalkDust wrote:<br>
&gt; On Wed, Jun 12, 2013 at 2:47 AM, David T. Lewis &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; On Tue, Jun 11, 2013 at 10:34:47PM -0700, Sean P. DeNigris wrote:<br>
&gt; &gt; &gt; When using PipeableOSProcess as a shell, how can I get feedback on the<br>
&gt; &gt; status<br>
&gt; &gt; &gt; of the individual commands?<br>
&gt; &gt; [snip]<br>
&gt; &gt; PipeableOSProcess is designed to be part of CommandShell, so when you use<br>
&gt; &gt; it<br>
&gt; &gt; directly (rather than using a CommandShell), you need to take care of a few<br>
&gt; &gt; details. The important things are to set the output pipe for nonblocking<br>
&gt; &gt; reads<br>
&gt; &gt; (otherwise you will hang up your VM on a read), and to close pipes when you<br>
&gt; &gt; are done using them (otherwise you will &quot;leak&quot; file handles over time).<br>
&gt; &gt;<br>
&gt; &gt; Dave<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; Could the example you gave be implemented using CommandShell? In what<br>
&gt; situations would I want to use PipeableOSProcess instead of CommandShell?<br>
<br>
</div></div>Good question. CommandShell works at a higher level, and it manages the<br>
annoying details of closing pipe handles and making sure that you do<br>
not block the VM. In most cases, it is easier to use CommandShell rather<br>
than operating directly on the lower level PipeableOSProcess.<br>
<br>
For example (to build on the earlier example), if you want to run the<br>
Unix &#39;ls&#39; command, and check its exit status to determine if a file was<br>
not found, it is not necessary to use the lower level PipeableOSProcess.<br>
You can do this instead:<br>
<br>
  CommandShell new<br>
    if: &#39;cd .. ; ls aFile&#39;<br>
    then: [&#39;the ls command succeeded&#39;]<br>
    else: [&#39;the file was not found&#39;] ==&gt; &#39;the file was not found&#39;<br>
<br>
Having said that, CommandShell is a simple simulation of a Unix shell,<br>
and it is not a complete replacement for something like bash. There<br>
are cases when you may need to use the features of a real Unix shell,<br>
so working directly with a PipeableOSProcess connected to /usr/bin/bash<br>
may be necessary in some cases.<br>
<div class="HOEnZb"><div class="h5"><br>
Dave<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Gary Dunn<br>Open Slate Project<br><a href="http://openslate.org/" target="_blank">http://openslate.org/</a>
</div>