perl - monitoring an exe applicaion launching -
I need to monitor the console exe application, in which the user does not have any stdin, it prints some information on the screen I used to have a POE: Wheel for this job
Below is my code:
Use POE qw (Wheel :: Run); POE :: Session-> Create (Inline_States = & gt; {_start = & gt; Sub} {My ($ stack) = $ _ [IEAP]; My $ run = POE :: Wheel :: Run-> New (program = & gt; my_program .exe ", StdoutEvent = & gt;" print "); $ heap-> {run} = $ run;}, print = & gt; sub {print" somthing ";}}); $ Poe_kernel- & gt; Run ();
When I run the code / script above and run my_program.exe, I did not see any print on the screen, someone could tell me what my problem might be is.
What can my problem be here?
-
my_program.exe
went to three possible candidates but no output was created -
my_program.exe
could not be executed. This program is not in the path, there are incorrect permissions, not executable, etc.
AStderrEvent
Perhaps this is the easiest way to catch it, as the child processwarning ()
exec ()
. About the failure in the - Your output line is buffer
"print"
state handler exits the output without a new line, which is not displayed until Until the output buffers are flavored When the wheel is removed from theHEAP
of the code, your script will not be expired, which you should do insig_child (and what else to do ) Can
handler
Comments
Post a Comment