Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How do I get output and return code, and time-out the process under Win 32?

by Anonymous Monk
on Apr 11, 2001 at 20:59 UTC ( [id://71746]=note: print w/replies, xml ) Need Help??


in reply to How do I get output and return code, and time-out the process under Win 32?

I managed to get it working myself, using something like the following code:
open ERROR, ">stderr.txt" or die $!; open OUTPUT, ">stdout.txt" or die $!; open SAVEERR, '>&STDERR' or die $!; open SAVEOUT, '>&STDOUT' or die $!; STDERR -> fdopen (\*ERROR, "w") or die $!; STDOUT -> fdopen (\*OUTPUT, "w") or die $!; $create = Win32::Process::Create($processObj, "program.exe", "-args", +1, NORMAL_PRIORITY_CLASS, "."); if ($create != 0) { if ($processObj->Wait(60000)) { $processObj->GetExitCode($result); } else { $processObj->Kill(999); } }
  • Comment on Re: How do I get output and return code, and time-out the process under Win 32?
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-20 05:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found