[erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes?

Tim Watson <>
Wed Sep 26 23:57:12 CEST 2012


On 26 Sep 2012, at 22:54, Tim Watson wrote:
> 
> Can someone explain to me what's going on here? Is this an issue with the exec call, and if so what is the problem with it? I've got a minimal example using exec that doesn't behave like this, so I'm a bit bemused. What's really confusing is that the process the port is used to open should presumably be closed regardless of what some sub-process is doing, and I thought that exec returned the stdout of the subprocess anyway!?
> 

Oh and I'm under the impression that there's no way for the connected process to block the stdout for the port program right? My reading of the bif is that we end up with erts_open_driver (is that right?) and that io between the port program and emulator will ultimately result in driver_output (or a similar friend) passing messages on to the connected process. Is that correct, and presumably under the smp emulator this is perfectly safe and so on?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120926/b2c73e9d/attachment.bin>


More information about the erlang-questions mailing list