[Newbies] Reading context from UnixProcess

Jim O'Connor oconnor at srccomputers.com
Mon Apr 7 04:47:29 UTC 2008


I'm having trouble figuring out how to collect input from an externally
executed linux process. 

The simple example below should, I think let me dump the contents 
of the directory /etc.  The stream type returned by initialStdOut is
AttachableFileStream.  Sending the contents message to it generates
a primitive error, caused I think because the stream's instance variable
position turns out to be nil on inspection.

p := UnixProcess command: 'ls -l /etc/'
s := p initialStdOut
s contents

What am I doing wrong or missing?

Better would be if someone has a simple code snippet the executes an
external process and then accepts output from it asynchronously.

Thanks.

Jim




More information about the Beginners mailing list