Path: utzoo!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!hplabs!hpda!hpcupt1!hpisod2!decot From: decot@hpisod2.HP.COM (Dave Decot) Newsgroups: comp.unix.questions Subject: Re: tail -f Message-ID: <10650037@hpisod2.HP.COM> Date: 10 Dec 88 01:50:13 GMT References: <412@fedeva.UUCP> Organization: Hewlett Packard, Cupertino Lines: 17 > >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. I suppose it could use select(2)... Dave