In addition to using Gforth in pipes created by other processes
(see Gforth in pipes), you can create your own pipe with
open-pipe, and read from or write to it.
open-pipec-addr u wfam – wfileid wior gforth “open-pipe”
close-pipewfileid – wretval wior gforth “close-pipe”
If you write to a pipe, Gforth can throw a
you don't catch this exception, Gforth will catch it and exit, usually
silently (see Gforth in pipes). Since you probably do not want
this, you should wrap a
try block around the code
close-pipe, so you can deal with the
problem yourself, and then return to regular processing.
broken-pipe-error– n gforth “broken-pipe-error”
the error number for a broken pipe