I wish to create a process using java's runtime: for example. Process proc = Runtime.getRuntime().exec("cmd");
Then, I want to somehow wait for the process until it is in 'ready for input' state, which will verify it has finished all of its work. Anyway on how to do it?
One thing that is possible is echoing "---finished---" and checking if this line was written using the stdin of the process. But I dislike the idea.
Is there any better (more formal) approach to do this?
By the way, I need this effect as I descriobed it. I want to wait before writing new commands to the batch file.
Thank you.