<div dir="ltr">I tried to use your code but I don'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"><<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>></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>
> On Wed, Jun 12, 2013 at 2:47 AM, David T. Lewis <<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>> wrote:<br>
><br>
> > On Tue, Jun 11, 2013 at 10:34:47PM -0700, Sean P. DeNigris wrote:<br>
> > > When using PipeableOSProcess as a shell, how can I get feedback on the<br>
> > status<br>
> > > of the individual commands?<br>
> > [snip]<br>
> > PipeableOSProcess is designed to be part of CommandShell, so when you use<br>
> > it<br>
> > directly (rather than using a CommandShell), you need to take care of a few<br>
> > details. The important things are to set the output pipe for nonblocking<br>
> > reads<br>
> > (otherwise you will hang up your VM on a read), and to close pipes when you<br>
> > are done using them (otherwise you will "leak" file handles over time).<br>
> ><br>
> > Dave<br>
> ><br>
> ><br>
> Could the example you gave be implemented using CommandShell? In what<br>
> 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 'ls' 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: 'cd .. ; ls aFile'<br>
then: ['the ls command succeeded']<br>
else: ['the file was not found'] ==> 'the file was not found'<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>