On 2012-05-03, at 07:29, Sean P. DeNigris wrote:
Igor Stasenko wrote
If you are on linux, you can do just:
stream := FileStream readOnlyFileNamed: '/dev/stdin'. stream nextLine
Unfortunately, Squeak VM doesn't provides a default API for working with stdin/out,
Is anyone able to use stein from inside an image? I found a lot of mailing list posts about it, esp. around Coral, but I'm not sure if it ever made it into the image...
On Mac OS X Lion with recent Jenkins Cocoa Cog Jit VM, none of the following seemed to work (most hung the image): FileStream stdin upToEnd. FileStream stdin next. (FileStream fileNamed: '/dev/fd/0') readStream nextLine. (FileStream fileNamed: '/dev/stdin'). "Can't even create. symlink on OS X"
blocking on stdin is normal since most probably there is no data yet. If you run cog / stack vm from the command line you will be able to read stuff. However the default settings for stdin allows you only to receive full lines, not single characters.