Skip to content

Support reopening when file is replaced (tail --follow=name) #2

@charles-dyfis-net

Description

@charles-dyfis-net

At present, pytailer does not poll for whether a file's direntry has been replaced, as during log rotation; GNU's version of the tail command does have this functonality.

Add an optional flag to the follow() call to persist in following a file even when that file has been rotated. If this flag is set and no new content is available after a sleep, the directory entry should be checked to determine whether it points to the same inode -- and if a new file replaces the old one, that new file should be opened and all lines from the very top of the file returned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions