in reply to Windows filehandles and fork
I'll be honest, I'm not entirely certain what is going on here, but here are two versions that at least seem to work. Perhap's some kind monk can tell me (and the OP) why these seem to work properly.
if ($pid=fork() ) { select(undef,undef,undef,.1); open (STDOUT, ">test.txt"); print "parent\n"; } else { print "child\n"; }
... and...
if ($pid=fork() ) { #select(undef,undef,undef,.1); print "parent\n"; } else { open (STDOUT, ">test.txt"); system("echo child"); }
update: commented out the select line in second example.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Windows filehandles and fork
by egarland (Acolyte) on Apr 09, 2004 at 02:45 UTC | |
|
Re: Re: Windows filehandles and fork
by egarland (Acolyte) on Apr 09, 2004 at 06:36 UTC | |
by Koosemose (Pilgrim) on Apr 09, 2004 at 06:53 UTC | |
by egarland (Acolyte) on Apr 13, 2004 at 12:14 UTC |