Hmm, I've tried doing it from a non-headless image. Maybe it has something to do with it? Guille On Mon, Jan 30, 2012 at 8:34 AM, Sven Van Caekenberghe <sven@beta9.be>wrote:
On 30 Jan 2012, at 11:44, Guillermo Polito wrote:
FileStream stdout nextPutAll: 'something';crlf.
Works great, but
FileStream stdin next.
Never returns :/. Whatever I try.
Any idea?
That is not good, I must admit I only tried #stout, so I did:
$ cat run.sh
#!/bin/bash script_home=$(dirname $0) script_home=$(cd $script_home && pwd) image=$script_home/experimental.image script=$script_home/run.st args=$* vm=$script_home/bin/CogVM options="-vm-display-null -vm-sound-null" #echo $vm $options $image $script $args $vm $options $image $script $args
$ cat run.st [ FileStream stdin atEnd ] whileFalse: [ FileStream stdout nextPut: FileStream stdin next ]. ! Smalltalk snapshot: false andQuit: true.
$ cat /tmp/foo.txt Hello there! Welcome to Smalltalk.
$ cat /tmp/foo.txt | ./run.sh Hello there! Welcome to Smalltalk.
So that seems to work.
HTH,
Sven