[erlang-questions] Re: Chain two spawned processes

Max Lapshin <>
Mon Oct 19 09:41:18 CEST 2009


> I don't know if this applies to your problem, but when using {spawn,
> Cmd} to open the port, the runtime actually starts a shell process to
> evaluate Cmd, so you can use shell redirections to pipeline from one
> command to another:

Actually I wanted to distinguish their error streams (to detect status) and
I was going to use open_port({spawn_executable,  which does execle.

I need just several API functions:
1) get output fd of spawned process (it is ofd[1]),
2) set 'passive' mode to spawned process so that it doesn't send any
messages to controlled process
3) set output fd as input fd to next spawned process.
4) close this ofd[1] in master process

Without this api, only spawning shell cmd is possible, but it is not enough =(


More information about the erlang-questions mailing list