Re: Logfile roll-over

Marc dirix <[email protected]> Fri, 21 Apr 2017 09:39:21 +0000
Newsgroups gmane.comp.lang.pike.user
Message-ID <CAERi-x0ZQpfNqfYKqjbB0cq1itRVa2yXFJm+=69DR-MExcbWxg@mail.gmail.com>
Ok thanks. I think that is a good solution.

/M

Op vr 21 apr. 2017 om 11:09 schreef Stephen R. van den Berg <[email protected]>:

> Lance Dillon wrote:
> >What some programs do is not keep the file open, but open it new each
> time, keeping a pointer to where it was last.?? If you are unable to seek
> that far, it means the log file has been restarted, and so seek back to the
> beginning and start over.
>
> What tail --follow does (I think), is keep the file open, but
> if the file does not show any new content after
> a certain timeout it periodically stats() the file and checks
> if the mtime of the file is higher than the last time that it
> received something through the open filedescriptor.  If yes,
> it then closes and reopens the file.
> --
> Stephen.
>
>