python-inotify-tail_example
python-inotify-tail_example copied to clipboard
Tailing of re-created files
An issue reveals itself when tailing files that are re-created. The following snippet shows what happens. GNU's 'tail -F' shows "1 2 4 5 6"
term a:
$ touch /tmp/myfile
term b:
$ python tail-F_inotify.py --debug /tmp/myfile
term a:
$ echo 1 >> /tmp/myfile
$ echo 2 >> /tmp/myfile
$ echo 3 > /tmp/myfile # > instead of >>
$ echo 4 >> /tmp/myfile
$ echo 5 >> /tmp/myfile
$ echo 6 >> /tmp/myfile
term b output:
I am totally opening /tmp/myfile
1
2
5
6
Thanks for your report! I think in later implementations, I've fixed this... but never added the code to this example app. I'll get it merged soon.