Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jun 2003 04:18:04 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Tony Finch <dot@dotat.at>
Cc:        oremanj@www.get-linux.org
Subject:   Re: kqueue alternative?
Message-ID:  <3EEDA76C.43795D89@mindspring.com>
References:  <1079.10.0.81.10.1055692530.squirrel@www.mundomateo.com> <Pine.NEB.3.96L.1030615125423.98988D-100000@fledge.watson.org> <E19RrTD-0006yV-00@chiark.greenend.org.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Tony Finch wrote:
> Joshua Oreman <oremanj@webserver.get-linux.org> wrote:
> >On Sun, 15 Jun 2003, Matthew Hagerty wrote:
> >>
> >> I'm writing a little application that needs to watch a file that another
> >> process is writing to, think 'tail -F'.
> >
> >I would say, use select(2).
> >Is there a reason this wouldn't work?
> 
> Select doesn't work with files.

The current "tail -f" uses kqueue.  The prior "tail -f" used
to open the file, and fstat() it in a 1 second sleep() loop,
looking for the file to get larger.

So your "alternative to kqueue" is to sleep loop and fstat.

-- Terry



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EEDA76C.43795D89>