According to:
Java IO implementation of unix/linux "tail -f"
I assume its possible but I have the following problem.
String TailCommand = "tail -f /path/PATH.txt| grep (...)";
Runtime r = Runtime.getRuntime();
Process p = r.exec(TailCommand);
//handle buffer
while (running) {
// handle output
}
Process p terminates. It works fine with commands that doesnt have constant updates unlike "top" or "tail -f".
I wonder if I missed something, there is some buffer limitations or whatever? Im using eclipse but i guess that should not have any impact on process behavior.
In fact maybe there is another simply way to solve my issue that i missed. Im using "tail -f" since i have to analyze quite fat(some GBs) log thats constantly appending and dont intend to open it and read the whole file. I need only to controll the appending lines. However i found no suitable tail implementation
Thanks in advance.