R
reid
Hi. I'm developing a Java app that will run on Windows. I need to
exec an external process and read its stdout to verify that it's
started correctly. (It should never exit until my app does.) I've
written some code that uses ProcessBuilder to execute the process,
which seems to work fine. I've redirected its error stream to the
output stream, and I've created a thread to monitor the input. I
never get anything, though. The app only writes about ten lines, so
I'm guessing that the app is buffering its output so my Java app never
sees it. (This is backed up by seeing that, in cmd.exe, I can
redirect the output to a file and never see it in the file until the
app exits.) Unfortunately, this is a third party commercial app, so I
can't modify it. Is there some way to force the app's output to be
unbuffered? I suppose this is more of a Windows question, but I
thought I'd check here to see if anyone has come up with a solution.
TIA!
Reid
exec an external process and read its stdout to verify that it's
started correctly. (It should never exit until my app does.) I've
written some code that uses ProcessBuilder to execute the process,
which seems to work fine. I've redirected its error stream to the
output stream, and I've created a thread to monitor the input. I
never get anything, though. The app only writes about ten lines, so
I'm guessing that the app is buffering its output so my Java app never
sees it. (This is backed up by seeing that, in cmd.exe, I can
redirect the output to a file and never see it in the file until the
app exits.) Unfortunately, this is a third party commercial app, so I
can't modify it. Is there some way to force the app's output to be
unbuffered? I suppose this is more of a Windows question, but I
thought I'd check here to see if anyone has come up with a solution.
TIA!
Reid