hosh icon indicating copy to clipboard operation
hosh copied to clipboard

follow

Open dfa1 opened this issue 5 years ago • 0 comments

Problem Would be nice to have a tail -F clone (following file rotations).

Solution Several working solutions are possible:

  • BufferedReader.readLine() + Thread.sleep()
  • RandomAccessFile + Thread.sleep()
  • https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/Tailer.java

Beware: on Windows sun.nio.fs.WindowsFileAttributes#fileKey yields null.

Benefit Portable alternative to tail -F that works on Windows out-of-the-box.

dfa1 avatar May 23 '20 22:05 dfa1