Rod Hynes 8a972ef75d Use Go modules %!s(int64=3) %!d(string=hai) anos
..
.travis.yml 8a972ef75d Use Go modules %!s(int64=3) %!d(string=hai) anos
LICENSE ece24d19a3 Vendor most remaining dependencies %!s(int64=8) %!d(string=hai) anos
README.md ece24d19a3 Vendor most remaining dependencies %!s(int64=8) %!d(string=hai) anos
rotate.go ce75194a32 Mitigate "permission denied" errors when writing logs %!s(int64=5) %!d(string=hai) anos

README.md

Build Status

Rotate Safe Writer

Makes an io.Writer that is resilient to inode changes (as caused by logrotate, file deletion, etc.)

This can be used anywhere that requires the io.Writer interface to be satisfied (including os.File). See the tests for usage examples

It works by storing the file's inode as it is opened, then checking whether or not the file at the original path still has the same inode value prior to calling File.Write(). If the inode has changed, the file at the original path will be re-opened, the new inode stored, then the write will continue as normal.