[squeak-dev] [OSProcess] How to read the stdout of a process running an infinite loop?

Noury Bouraqadi bouraqadi at ensm-douai.fr
Thu May 22 12:56:25 UTC 2008


Thanks David. We'll give it a try.

Noury
On 21 mai 08, at 04:48, David T. Lewis wrote:

> On Tue, May 20, 2008 at 05:10:45PM +0200, Noury Bouraqadi wrote:
>> Hi,
>>
>> Gautier and I have a software written in C that loops infinitly doing
>> some computations. At every iteration it displays something on the
>> shell. We want to read the output into squeak. We can not wait for  
>> the
>> end of the computations, since it's an infinite loop :-)
>>
>> Any hints?
>
> Try the attached change set for an example. I made a shell script that
> generates output, named it "test.sh", and ran it from Squeak as  
> follows.
>
> 	| proxyWatcher |
> 	proxyWatcher := ReadFromExternalProgram programName: 'test.sh'.
> 	proxyWatcher start.
> 	(Delay forSeconds: 10) wait.
> 	proxyWatcher stop.
>
> The proxyWatcher runs the external program for 10 seconds, copying its
> output to the Transcript as new data becomes available.
>
> Hope this helps,
> Dave
>
> <ReadFromExternalProgram-dtl.2.cs.gz>

Noury Bouraqadi
------------------------------------------------------------------
Dr. Noury Bouraqadi - Enseignant/Chercheur
Responsable de l'enseignement de l'informatique
ARMINES - Ecole des Mines de Douai - Dept. I.A.
http://vst.ensm-douai.fr/noury

European Smalltalk Users Group Board
http://www.esug.org
------------------------------------------------------------------







More information about the Squeak-dev mailing list