<<>> <> <> <> <<>> DIRECTORY CedarProcess, IO, Rope, UnixTypes; UnixSpawnTCP: CEDAR DEFINITIONS ~ BEGIN <> <> <<>> FinishProc: TYPE ~ PROC [status: ATOM --$NotFound, $Completed--, clientData: REF ANY]; SpawnData: TYPE ~ RECORD [ fd1, fd2: UnixTypes.FileDescriptor, -- stdout or stderr fdOut: UnixTypes.FileDescriptor, -- stdout pid: INT, -- process id, for abort readOut: CedarProcess.ForkableProc, -- procedure forked for read stdout watch1, watch2: CedarProcess.Process, -- forked read process for fd1, fd2 readOutProcess: CedarProcess.Process, -- forked read process for stdout finish: FinishProc, -- called upon completion of Unix process clientData: REF ANY, -- passed to finish out, err: IO.STREAM]; -- out and err Cedar streams Spawn: PROC [ command: Rope.ROPE, out, err: IO.STREAM ¬ NIL, finish: FinishProc ¬ NIL, readOut: CedarProcess.ForkableProc ¬ NIL, clientData: REF ANY ¬ NIL] RETURNS [REF SpawnData]; <> <> <> <> Kill: PROC [s: REF SpawnData]; <> Write: PROC [s: REF SpawnData, rope: Rope.ROPE]; <> Close: PROC [s: REF SpawnData]; <> END.