Communicating with a background process

Leslie Mikesell les at chinet.chi.il.us
Fri Nov 18 07:35:58 AEST 1988


In article <4454 at phoenix.Princeton.EDU> ssroy at phoenix.Princeton.EDU (Steve Scot Roy) writes:
>My problem is that I cannot find how to open a *two way* communication
>line to a program.  popen(...) claims to set up a one way pipe to
>another program, but I need two way communication.

If you have SysV you can use FIFOs (named pipes) and it can even be done
using shell scripts.  Use mknod filename p to create a FIFO, then
redirect input/output as you would with other files.  If you want a
read from the FIFO to always block even if no other process currently
has it open for writing, just have the reading process also open it
for output (but don't write anything).

Les Mikesell



More information about the Comp.unix.questions mailing list