Fork: Difference between revisions

Content deleted Content added
Line 268: Line 268:
)
)
</lang>
</lang>

Finally, we can define a function test_pipe which tests the whole apparatus:


<lang fexl>
<lang fexl>
\test_pipe =
(\next
print "== test_pipe";nl;

### Handy

\file_print ==
(\fh\next
fgetc fh \ch
long_lt ch 0 next;
putchar ch;
file_print fh next
)

\show_stream =
(\label\fh\next
print "[ ";print label;print ":";nl;
file_print fh;
print "]";nl;
next
)

### Here is a child function to try with spawn.
### Here is a child function to try with spawn.


Line 281: Line 305:
next
next
)
)

# Spawn the child.
# Spawn the child.
spawn child_fn \pid\child_in\child_out\child_err
spawn child_fn \pid\child_in\child_out\child_err
Line 314: Line 337:
print status;print ".";nl;
print status;print ".";nl;
print "Good bye from parent.";nl;
print "Good bye from parent.";nl;

print "test_pipe completed successfully.";nl;
next
)
</lang>
</lang>