Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 ( #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
Node Status?
node history
Node Type: note [id://71746]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2021-05-09 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (100 votes). Check out past polls.

    Notices?