Skip to content
Snippets Groups Projects
Commit df843647 authored by Anthony Woods's avatar Anthony Woods Committed by Ed
Browse files

handle symbolic links correctly (#275)

* handle symbolic links correctly

When tailing a file that is rotated we expect that a fsnotify.Rename
event will be sent when the old file is renamed and a fsnotif.Create
event will be sent when the replacement file is created. This allows
us to close and re-open the file.  However if the file we are
tailing is a symbolic link (and the target is in another directory)
we wont get these events.  To address this we need to tail the target
file directly.

fixes #274

* handle symlinks being re-linked

When a symbolic link is re-linked we will only get a fsnotify.Create
event. No rename or delete event will have been sent to trigger
the tailer to be stoped.  When this happens we should stop the current
tailer for the path and start a new one. This will allow us to perform
a new Readink on the path to get the updated target filename.
parent 7763e8f3
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment