有shell命令:
tail -n0 -f /path/to/growing/log
连续显示文件的新添加的行。
请指导我实现朱莉娅的目标!
答案 0 :(得分:3)
只需重复读取文件即可:
file = open("/path/to/growing/log")
seekend(file) # ignore contents that are already there to match the `-n0` option
while true
sleep(0.2)
data = read(file, String)
!isempty(data) && print(data)
end