in reply to Re: Windows weirdness after fork, dup2
in thread Windows weirdness after fork, dup2
I find that it's not using the right file descriptor:open STDOUT, ">&SOCK_WRITE" or die "STDOUT: $!\n"; warn "fileno(STDOUT)=",fileno(STDOUT),"\n";
so when I exec a new process it doesn't have the file handles hooked up right. For example, if I change the infinite sleep loop to actually run something:fileno(STDOUT)=3
the output from the child goes to the console, not the socket. With dup2, it goes to the socket.exec('perl','-e','$|=1; while(1) { sleep(5); print q:The time is now : +,time,qq:\n:; };') or die "exec error: $!\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Windows weirdness after fork, dup2
by Thelonius (Priest) on Mar 05, 2004 at 21:15 UTC | |
by sgifford (Prior) on Mar 05, 2004 at 21:55 UTC |