in reply to Re: how to cath STDOUT from an external app, that never exits?
in thread how to catch STDOUT from an external app, that never exits?

My mainscript does a few more things, but...

...if I understand you correctly, I can do the following:

Mainscript:
system("application.exe 2>&1 | logscript.bat &");
which opens application.exe in the background and gives all STDOUT and STDERR to logscript.bat.

And I have to write a pl2bat'ed logscript.bat, which only has to cope with its STDIN, the way you coded it. Right?
I'll try this now.

Thanks!

Thorsten
  • Comment on Re: Re: how to cath STDOUT from an external app, that never exits?
  • Download Code

Replies are listed 'Best First'.
Re: Re: Re: how to cath STDOUT from an external app, that never exits?
by ThorstenHirsch (Novice) on Apr 09, 2003 at 13:53 UTC
    Hmmm...the thing with the logfile works. Thank you, my hero ;-)

    But I cannot get my application.exe starting up in the background! Both
    system("application.exe 2>&1 | logscript.bat &"); open3(NULL, ">&NULL", ">&NULL", "application.exe 2>&1 | logscript.bat +&");

    wait for application.exe to be finished or terminated.

    I'd be glad if someone would help me with this last piece of the puzzle.

    Thorsten