Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Windows filehandles and fork

by esskar (Deacon)
on Apr 09, 2004 at 01:19 UTC ( [id://343821]=note: print w/replies, xml ) Need Help??


in reply to Windows filehandles and fork

i guess that under windows fork is implemented using threads so the child does not have his own STDOUT. Why are you dont you open a new filhandle in each child process and better use $fh as a handle not the FH thing.

just my 50 cent..

Replies are listed 'Best First'.
Re^2: Windows filehandles and fork
by bart (Canon) on Apr 09, 2004 at 08:07 UTC
    i guess that under windows fork is implemented using threads so the child does not have his own STDOUT.
    My guess is that that is indeed what is happening.
    Why are you dont you open a new filhandle in each child process
    Because he wants to use it together with system(), and that won't work as intended, with any other filehandle.

    Update: Gee, Koosemose appears to be right, this does seem to work right (at least on Win98):

    open CHILDOUT, ">test.txt"; select CHILDOUT; system('perl -le "print q(Hello!)"');

    I think that would indeed solve it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://343821]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-19 09:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found