It logs waiting for file to appear. If i create the file now in a text editor, enter some lines and save, tail correctly detect there are new lines. However, if the file is created by another program and not closed, for example, this python script:
with open(outputFilename, 'w') as f:
for i in range(100):
f.write(str(i))
f.write('\n')
f.flush()
time.sleep(1)
Then the tail doesn't detect file exist before the file is closed. But the file content does changed before it's closed. I can verify by 1) open the file in a text editor; or 2) rerun the go tail program, this time it can watch the file line by line.
When doing this on an inexist file:
It logs
waiting for file to appear
. If i create the file now in a text editor, enter some lines and save, tail correctly detect there are new lines. However, if the file is created by another program and not closed, for example, this python script:Then the tail doesn't detect file exist before the file is closed. But the file content does changed before it's closed. I can verify by 1) open the file in a text editor; or 2) rerun the go tail program, this time it can watch the file line by line.