My code should call some external programs that sometimes freeze. (endless loop, never coming back)
To start an external process, I use:
import tools.nsc.io.Process val res = Process("ls") res.foreach(println) res.waitFor // waits until a Process is finished but if it hanging waitFor will not return or res.destroy // kills a process
But I did not find a way to check if the process continues. Or waitFor (time), so I'm only waiting for a while.
I believe that they should be a simple solution, but I cannot find it ...
source share