OSProcess output to pharo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

OSProcess output to pharo

Lusa Nicolas
Hi,

I am doing some work with OSProcess and I want to get the output directly to pharo (i.e. a stream or a byteString would be cool).
I have found this on the web http://pharo.gemtalksystems.com/book/PharoTools/OSProcess/ where it's said that if you want access to the output you have to use PipeableOSProcess from CommandShell project.
My question is: is still this the correct way to do it or meanwhile in OSProcess something was implemented to handle this specific case?

Thanks.
Cheers,
Nicolas
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess output to pharo

David T. Lewis
Yes, that is the correct way to do it.

I think that the ConfigurationOfOSProcess for Pharo includes a portion of
the CommandShell package, so if you load OSProcess from that configuration
you should also get the necessary PipeableOSProcess. That said, I would
still encourage you to load the full CommandShell package and explore some
of the other things it it :-)

ConfigurationOfOSProcess and ConfigurationOfCommandShell have both been
recently updated for Pharo.

Dave


> Hi,
>
> I am doing some work with OSProcess and I want to get the output directly
> to pharo (i.e. a stream or a byteString would be cool).
> I have found this on the web
> http://pharo.gemtalksystems.com/book/PharoTools/OSProcess/ where it's said
> that if you want access to the output you have to use PipeableOSProcess
> from CommandShell project.
> My question is: is still this the correct way to do it or meanwhile in
> OSProcess something was implemented to handle this specific case?
>
> Thanks.
> Cheers,
> Nicolas
>



Reply | Threaded
Open this post in threaded view
|

Re: OSProcess output to pharo

Lusa Nicolas
That's perfect, thank you!

Nicolas

On Apr 28, 2015, at 5:39 PM, David T. Lewis <[hidden email]> wrote:

> Yes, that is the correct way to do it.
>
> I think that the ConfigurationOfOSProcess for Pharo includes a portion of
> the CommandShell package, so if you load OSProcess from that configuration
> you should also get the necessary PipeableOSProcess. That said, I would
> still encourage you to load the full CommandShell package and explore some
> of the other things it it :-)
>
> ConfigurationOfOSProcess and ConfigurationOfCommandShell have both been
> recently updated for Pharo.
>
> Dave
>
>
>> Hi,
>>
>> I am doing some work with OSProcess and I want to get the output directly
>> to pharo (i.e. a stream or a byteString would be cool).
>> I have found this on the web
>> http://pharo.gemtalksystems.com/book/PharoTools/OSProcess/ where it's said
>> that if you want access to the output you have to use PipeableOSProcess
>> from CommandShell project.
>> My question is: is still this the correct way to do it or meanwhile in
>> OSProcess something was implemented to handle this specific case?
>>
>> Thanks.
>> Cheers,
>> Nicolas
>>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: OSProcess output to pharo

Pierce Ng-3
In reply to this post by David T. Lewis
On Tue, Apr 28, 2015 at 11:39:56AM -0400, David T. Lewis wrote:
> Yes, that is the correct way to do it.

David,

It seems Command Shell doesn't handle REPL applications like the sqlite3 shell,
tclsh and goodsrv. How difficult is that to implement, in your view?
Alternatively (unless they are the same stuff underneath) how to go about
building something like Expect or pexpect?

Pierce

Reply | Threaded
Open this post in threaded view
|

Re: OSProcess output to pharo

David T. Lewis
On Fri, May 01, 2015 at 09:04:59AM +0800, Pierce Ng wrote:
> On Tue, Apr 28, 2015 at 11:39:56AM -0400, David T. Lewis wrote:
> > Yes, that is the correct way to do it.
>
> David,
>
> It seems Command Shell doesn't handle REPL applications like the sqlite3 shell,
> tclsh and goodsrv. How difficult is that to implement, in your view?
> Alternatively (unless they are the same stuff underneath) how to go about
> building something like Expect or pexpect?

Hi Pierce,

I'm not sure if I am understanding your question, but please have a
look at PipeableOSProcess class>>tkExample. This is an example of having
your image talking to a REPL shell, /usr/bin/wish in this case, but
probably similar to a sqlite3 shell. The wish shell is a tclsh interpreter
with Tk gui, so I expect that is close to what you are trying to do.

If you are interested in having your squeak/pharo image be the REPL
server, then class ExternalCommmandShell may be closer to what you want.

Dave