[squeak-dev] reading and writing from STDIN and STDOUT

Casimiro de Almeida Barreto casimiro.barreto at gmail.com
Sat May 16 01:58:08 UTC 2009


David T. Lewis escreveu:
> (...)
> Do you mean that the external library is writing to stdout, and you
> want to be able to see that output from within the Squeak image? In
> that case you want Squeak to be reading its own standard output, and
> redirecting it to the Transcript?
>   
Exact. It is writing to stdout. I want to capture that and be able to
transcribe into the Transcript.
> There is probably some way to do that, although I can't think of anything
> right now. If you don't need to be too fancy about it, consider just
> directing stdout to a file and periodically reading the file contents
> from Squeak.
>   
Yes... it must be a way of doing that...
> Or direct stdout to a named pipe (unix mkfifo command) and read from
> the named pipe. If you use a named pipe, you will need to open it as
> a file stream in Squeak, then set the file stream to non-blocking mode
> before you use it, otherwise you will lock up your Squeak VM. Search
> for methods with 'setnonblocking' in the name. It's somewhere in
> OSProcess, but I don't have Squeak with me to check right now.
>
> Dave
>
>
>
>   




More information about the Squeak-dev mailing list