[squeak-dev] debugging PipeableOSProcess

Jimmie Houchin j.squeak at cyberhaus.us
Thu Mar 6 22:05:22 UTC 2008


David T. Lewis wrote:
> On Wed, Mar 05, 2008 at 11:30:31PM -0600, Jimmie Houchin wrote:
[snip]
> Jimmie,
> 
> Try using an object explorer. You can "drill down" into this to see
> the pipes, the process proxy, and so forth. The pipes are implemented
> by ExternalPipe, OSPipe and InternalPipe, which are all implementations
> of Stream.

If I understand you correctly, I can't do that when the UI is locked?
And so far the UI has remained locked until I kill wget. :)

> I'm not sure what is causing your wget process to hang up, but just
> as a suggestion you might try using ProxyPipeline class>>command: rather
> than PipeableOSProcess class>>command: to run the wget command. The
> difference is that the latter uses a real Unix shell (/bin/bash) to
> run the wget command, while ProxyPipeline uses a Smalltalk simulation
> of the shell to directly run the wget program with no /bin/bash
> involved at all. It might be worth a try to see if taking the extra
> /bin/bash process out of the equation makes a difference.

Thanks for this suggestion. It worked beautifully. I changed everyplace
I was using PipeableOSProcess to use ProxyPipeline and everything is
working as desired.

With wget I am only wanting the files desired. But I have written
wrappers around other commandline tools where I require the output in
order to process the output to use for arguments to other commandline
tools. Heretofore I was using PipeableOSProcess and doing a simple
substitution to ProxyPipeline has gone without problem.

The only thing that I miss somewhat with PipeableOSProcess that I don't
see with ProxyPipeline is the ability to set a current working directory
for the process to run in. I presume it uses the directory of the Squeak
image I am using.

> (Note, ProxyPipeline is a container for one or more connected
> processes, so use an object explorer to see how it is working.
> For your wget example, it will be a container with one instance
> of PipeableOSProcess, and that instance of PipeableOSProcess
> will be running the wget OS process rather than running a
> /bin/bash process. Also, ProxyPipeline implements streaming
> protocol itself, so you can read from its output and error pipes
> directly as if it were a PipeableOSProcess.)

Thanks for the information.

Thank you again for all of this help. It has saved my day.

And a big thank you, thank you, thank you for writing this package in
the first place. It saves me from having to write wrappers in Python
when I would much rather spend my time using and learning more of Squeak.

Have a great day.

Jimmie



More information about the Squeak-dev mailing list