Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I am able to connect to my process when passing in the process id which I obtained from processinfo.pl..(idea is to grab the new process id and pass it in and then use it to monitor process so it keeps running continuously or something.. ) process info code followed by my process.pl code which is just to connect and tell me exit code as I don't really know yet how to do anything with it. stuff below code is ignorable.
use Win32::Process::Info; use Data::Dumper; $pi = Win32::Process::Info->new (); $pi->Set (elapsed_in_seconds => 0); # In clunks, not seconds. @pids = $pi->ListPids (); # Get all known PIDs @info = $pi->GetProcInfo (); # Get the max %subs = $pi->Subprocesses (); # Figure out subprocess relationships. @info = grep {$_->{Name} =~ m/vugen/} $pi->GetProcInfo (); # All processes with 'perl' in name. #print $info; #print $pi; my $href=\%subs; print Dumper $href; print Dumper @info; #print Dumper @pids;
use Win32::Process; use Win32; sub ErrorReport{ print Win32::FormatMessage( Win32::GetLastError() ); } Win32::Process::Open($Obj,$pid=12732,$iflags)|| die ErrorReport(); print "connected to process $pid "; $Obj->GetExitCode($exitcode); print $exitcode;
that sounds very much like what I want to do but how can I do it on a winblows system..(er I mean windows). I am looking at win32 process, but it's not clear how to export "still-active" I manage to get a bit over my head on this one,how do I explicitly export? so far I haven't gotten much, trying to figure out how to tell if still_active or setup a heartbeat or something. I can get it to launch but not to open my script.
use Win32::Process; use Win32; sub ErrorReport{ print Win32::FormatMessage( Win32::GetLastError() ); } Win32::Process::Create($ProcessObj, "C:\\program files\\Mercury\\LoadRunne +r\\bin\\vugen.exe", "E:\\Mibor_timingtest\\Mibor\\mibor.us +r", 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport(); Win32::Process::Open($Obj,$pid=11672,$iflags)|| die ErrorReport(); $ProcessObj->Suspend(); $ProcessObj->Resume(); $ProcessObj->Wait(INFINITE);
I am trying to figure this out has anyone used before? I get 259 as my exit code what does that mean?
use Win32::Process; use Win32; sub ErrorReport{ print Win32::FormatMessage( Win32::GetLastError() ); } Win32::Process::Open($Obj,$pid=11672,$iflags)|| die ErrorReport(); print "connected to process $pid"; #$ProcessObj->Suspend(); #$ProcessObj->Resume(); #$ProcessObj->Wait(INFINITE); $Obj->GetExitCode($exitcode); print $exitcode;

In reply to Re^2: monitor process by grashoper
in thread monitor process by grashoper

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
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: (2)
As of 2024-04-25 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found