in reply to Re: Re: Windows weirdness after fork, dup2
in thread Windows weirdness after fork, dup2

What you can do is set up the child to forward the output of the command to the main parent through the socket:
# child close(SOCK_READ); open CMD, "ipconfig|" or die "ipconfig: $!\n"; print SOCK_WRITE while <CMD>; exit(0);

Replies are listed 'Best First'.
Re: Re: Re: Re: Windows weirdness after fork, dup2
by sgifford (Prior) on Mar 05, 2004 at 21:55 UTC
    Ah, great idea! That worked. I had to add some kludginess to get CTRL-C to kill the grandchild process (and for some reason an INT signal wasn't enough, so I had to use KILL), but here's a final working version.