Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Win32: Redirect STDOUT to socket

by BrowserUk (Patriarch)
on Feb 09, 2009 at 18:46 UTC ( [id://742520]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Win32: Redirect STDOUT to socket
in thread Win32: Redirect STDOUT to socket

how does Perl do qx() in Win32?

There is a parameter bInheritHandles on CreateProcess() that needs to be set for spawned processes to inherit their parents open handles. That is a part of what qx// does.

You can access it using Win32::CreateProcess().


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^4: Win32: Redirect STDOUT to socket
by repellent (Priest) on Feb 10, 2009 at 07:34 UTC
    Thanks so much for the links! I tried to have the newly created process inherit filehandles from the calling process with no luck. Perhaps I'm missing something? See UPDATE #2.

      Sorry, but posting updates to the root node, and then new nodes saying you've done so just makes life harder for everyone. Why not just post the update in the new node?

      You are still using fork which gives you a thread not a process on win32. And you are still trying to use AF_UNIX, SOCK_STREAM, on win32 which doesn't make any sense as Win32 doesn't know about unix sockets.

        Will do. I was just trying to keep the root node up-to-date with where I'm at so far. In other SoPW posts, I personally felt it was difficult to track sequence when Notes branched out too much, often wishing that the OP would indicate which solution worked best with an update. YMMV.

        I have been playing around a lot with Win32::Process and this will require more meditation on my part. After much experimentation, I got a feel of the internals and now realize how the threaded fork gets in the way of the expectations of the OP.

        Thanks again, you've been a big help :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-25 19:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found