Execute another program from Pharo

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

Execute another program from Pharo

Frederic Pluquet-3
Hello,

I want to execute another program from Pharo and collect the result (everything shown on the console) as a string.

A basic example :

Console execute: 'ls -l /Users'

should return a string like:

'total 0
drwxrwxrwt   6 root  wheel   204 25 jan 23:03 Shared
drwxr-xr-x@ 46 user1  user1   1564  4 jui 07:46 user1
'

How can I do that ? A solution for OS-X is enough.

Fréd
----
Frédéric Pluquet
Université Libre de Bruxelles (ULB)
Assistant
http://www.ulb.ac.be/di/fpluquet

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Execute another program from Pharo

Adrian Lienhard
Hi Frédéric,

Check out OSProcess.

Cheers,
Adrian

On Jun 29, 2009, at 14:52 , Frederic Pluquet wrote:

> Hello,
> I want to execute another program from Pharo and collect the result
> (everything shown on the console) as a string.
>
> A basic example :
>
> *Console execute: 'ls -l /Users'*
>
> should return a string like:
>
> *'total 0*
> *drwxrwxrwt   6 root  wheel   204 25 jan 23:03 Shared* *drwxr-xr-x@  
> 46 user1
> user1   1564  4 jui 07:46 user1*
> *'*
>
> How can I do that ? A solution for OS-X is enough.
>
> Fréd
> ----
> Frédéric Pluquet
> Université Libre de Bruxelles (ULB)
> Assistant
> http://www.ulb.ac.be/di/fpluquet
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project