Named pipes

David T. Lewis lewis at
Sun Jan 1 20:14:49 UTC 2006

On Sun, Jan 01, 2006 at 10:00:56AM -0000, Cowdery, Bob [UK] wrote:
> > Load OSProcess from Squeak Map.
> > Make a named pipe called 'FIFO'.
> > In Squeak, open the named pipe as a file stream:
> >
> >   namedPipe := FileStream fileNamed: 'FIFO'.
> >
> > Set nonblocking:
> >
> >   OSProcess accessor setNonBlocking: namedPipe fileID.
> >
> Thanks very much Dave. I figured most of it. The bit that got me was the
> IOHandle that setNonBlocking wanted was a fileID. I am actually reading
> audio sampled data in binary mode and get a nil when the pipe is empty.

FYI, the "IOHandle" nomenclature comes from the IOHandle package (on
Squeak Map). This factors out the low level IO from the file stream and
socket classes. If you had IOHandle loaded, the #setNonBlocking: would
take an instance of IOHandle as its parameter, rather than the fileID.
But I have not kept IOHandle up to date with recent Squeak versions, so
don't try to load it.


More information about the Squeak-dev mailing list