It's easy to launch some program and then - when this program finishes - get a result (stdout, for instance). I use the following code:
But how can i get stream contents in real time?
Being precise, i have a program that prints a line every n seconds; and i want to launch it from java code and every n seconds process the line it prints.
posted 8 years ago
Ok, i found that problem is somewhere else - this code doesn't print output typically produced by Process.exe - it just exits.
UPD. It does exactly what i need, just a few lines need to be replaced: