Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!oliveb!3comvax!bridge2!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: tail -f Keywords: how does it work Message-ID: <655@auspex.UUCP> Date: 8 Dec 88 18:17:49 GMT References: <412@fedeva.UUCP> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 13 >Can someone please tell me how 'tail -f' works?. Obviously, it does not >do a busy loop while doing a stat on the file. I know that it has got >to be blocked, waiting for the length to change, but how does it get >notified of a change? Thanks in advance for any responses. Oh, dear, he used the "O" word. One should be careful using that word.... In fact, it *does* do a busy loop while doing "read"s (not "stat"s) of the file; it just sleeps 1 second between attempts to "read", so it doesn't burn quite so much CPU doing it. If there were some way for it to block waiting for the length to change, it would; however, there isn't any such way.