Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Aug 2001 18:28:56 -0500
From:      Alfred Perlstein <bright@mu.org>
To:        Matthew Hagerty <mhagerty@voyager.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: To determine if a file has grown?
Message-ID:  <20010827182856.L81307@elvis.mu.org>
In-Reply-To: <5.1.0.14.2.20010827185351.01ba3aa8@pop.voyager.net>; from mhagerty@voyager.net on Mon, Aug 27, 2001 at 07:27:54PM -0400
References:  <5.1.0.14.2.20010827185351.01ba3aa8@pop.voyager.net>

next in thread | previous in thread | raw e-mail | index | archive | help
* Matthew Hagerty <mhagerty@voyager.net> [010827 18:28] wrote:
> Greetings,
> 
> Is there a fast and/or efficient way to determine if a file size has 
> changed without reopening the file every time?  I'm writing a program that 
> needs to open a file and watch it to see when data gets written to the file 
> (from an external source or another part of the same program), then read 
> the data to process it.  I was looking at stat() but I've read that it is a 
> high overhead function.  Any insight would be greatly appreciated.

use kqueue.

-- 
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
start asking why software is ignoring 30 years of accumulated wisdom.'

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010827182856.L81307>