他のプロセスによって作成されたパイプライン(see Gforth in pipes)を Gforth で使用することに加えて、 あなたは
open-pipe
を使用してあなた独自のパイプラインを作成し、 読み書きすることができます。
open-pipe
( c-addr u wfam – wfileid wior ) gforth-0.2 “open-pipe”
close-pipe
( wfileid – wretval wior ) gforth-0.2 “close-pipe”
パイプラインに書き込む場合、 Gforth は broken-pipe-error
を throw する可能性があります。 あなたが、
この例外をキャッチしない場合、 Gforth は例外をキャッチして通常は黙って(silently)に終了(exit)します(see Gforth in pipes)。 しかし、 おそらくこれはあなたの望む事ではないので、 open-pipe
から close-pipe
までのコードを catch
または try
ブロックで囲むべきです。 そして、 あなた自身で問題を解決し、
通常の処理に戻します。
broken-pipe-error
( – n ) gforth-0.6 “broken-pipe-error”
壊れたパイプラインのエラー番号