de.cau.cs.kieler.esterel.cec
Class KonsoleExec
java.lang.Object
de.cau.cs.kieler.esterel.cec.KonsoleExec
public final class KonsoleExec
- extends Object
Utility class to execute external programs.
- Rating

Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
exec
public static InputStream exec(String cmd,
InputStream input,
int inittime,
int timeout,
int steptime)
throws KielerException
- Run an external process with a timeout. This method works for Linux/Mac and Windows.
- Parameters:
cmd
- command that is actually executedinput
- the input that is feed to the executed program (stdin)inittime
- time initialy, the process has this amount of time to produe the initial output.timeout
- the process is terminated timeout milliseconds after the last output was generatedsteptime
- time in milliseconds to wait between polling for output
- Returns:
- the output that was generated by the program (stdout)
- Throws:
KielerException
- throw for communication errors or if the return value of the process is not 0. In
this case, also the error stream is contained in the exception.