Java IO implementation of unix/linux “tail -f”

前端 未结 9 1915
我寻月下人不归
我寻月下人不归 2020-11-22 12:06

I\'m wondering what techniques and/or library to use to implement the functionality of the linux command \"tail -f \". I\'m essentially looking for a drop in add-on/replace

9条回答
  •  佛祖请我去吃肉
    2020-11-22 12:49

    If your code only ever will have to run on Unix systems, you may be able to get away with just shelling out and calling tail -f directly.

    As a more involved alternative, you could take a look at the implementation of GNU tail and port that over to Java. (I'm not sure whether this wouldn't already make your code a derivative work, though.)

提交回复
热议问题