What happens to stderr/stdout streams after Process#destroy() in Java?

Posted by Lajos Nagy on Stack Overflow See other posts from Stack Overflow or by Lajos Nagy
Published on 2010-03-30T20:46:14Z Indexed on 2010/03/31 0:33 UTC
Read the original article Hit count: 372

Filed under:

Here's my problem. I'd like to have a timeout for a process I start from Java. After the timeout, I'd like to kill the process. So far, so good. Problem is, I want to capture stderr/stdout during both normal execution and after a timeout. What happens if I kill the process with destroy()? Can I retrieve the (partial) stderr/stdout produced so far? Or are they gone?

© Stack Overflow or respective owner

Related posts about java