I'm trying a tail implementation of the follow option in java. It is supposed to print the last ten lines from a dynamically changing file. How exactly is one supposed to keep the program running. What should be the while loop condition?
while (true) {
Thread.sleep(1000);
long len = file.length();
long pointer = r.getFilePointer();
if (len < pointer) {
//Do something
}
else if (len > pointer) {
//Do something
}
}