0
votes

I'm using a 3rd party tool A which launches a long-running (weeks) console application B and catches the console output then display it. Unfortunately, the main application has a tendency to crash meaning it's no longer possible to monitor B.

I'd prefer not to restart B if it's been running for a while, but I need to know how it is progressing.

Ideally I'd like to write a really simple app that displays the console output of B (preferably .Net but anything that runs on Windows will do).

Is this possible for a process you haven't launched? If so, how?

1
Can we assume that B is writing to stdout/stderr rather than using direct console I/O? Is it possible to get A to launch a wrapper .exe of your choosing that then invokes B? That would be the only strategy I can see that would fit the category of "really simple".Ron Burk
Interesting question. I would hope so. The app is built against both Windows and Linux so I would assume stdout is the logical choice. I don't know for certain, however. As to tricking A into launching my wrapper, nothing configurable. I suppose I could try and swap executables - I'll give that a spin. Hopefully it's not signed :)Basic
@RonBurk Good thinking. Swapping the executable for my own wrapper was exactly what I needed - I just pass everything through while displaying to my own window. If you'd care to post as an answer, I'll accept.Basic

1 Answers

1
votes

Swap in your own executable in place of B that spawns B and sends its output two different places, more or less like the "tee" command does in *nix. (Good job swapping out the .exe -- didn't think of that!)