I'm writing a cod4 server controller in Java(I know there are perfectly fine server controllers out there, but I want to learn from it). Now I want to take specific actions according to entries in a logfile, this file is updated by cod very often, and the file can get quite large. Now how do I efficiently read only the part that has changed of the file, every second or so?
Or is there a way to send everything that is changed in the logfile live to Java?(I read something about pipes). The server runs on linux. It's not needed that the logfile is still saved in the same location, since everything should go through Java I can just save it with that.
A delay of about a second or 2 is acceptable, but not any longer.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…