We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os: centos 7 Repeat steps:
touch /tmp/test.log cat tail.go
package main import ( "github.com/ActiveState/tail" "log" ) func main() { t, err := tail.TailFile("/tmp/test.log", tail.Config{Follow:true, ReOpen:true}) if err != nil { log.Panic(err) } for line := range t.Lines { log.Printf(line.Text) } }
go run tail.go & rm /tmp/test.log touch /tmp/test.log echo "111" >> /tmp/test.log
you can see tail.go failed to reopen /tmp/test.log, because /tmp/test.log is already opened by tail.go,rm didn't really delete this file.
The text was updated successfully, but these errors were encountered:
Watch the *directory* for file deletions instead of the file itself.
cc7a23a
inotify works on the inode, not the path. Deleting the file doesn't touch the inode, so doesn't generate an event on the file. Fixes hpcloud#57
e681532
No branches or pull requests
os: centos 7
Repeat steps:
touch /tmp/test.log
cat tail.go
go run tail.go &
rm /tmp/test.log
touch /tmp/test.log
echo "111" >> /tmp/test.log
you can see tail.go failed to reopen /tmp/test.log, because /tmp/test.log is already opened by tail.go,rm didn't really delete this file.
The text was updated successfully, but these errors were encountered: