From owner-freebsd-hackers Mon Aug 27 16:29:11 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id 30D9637B401 for ; Mon, 27 Aug 2001 16:29:07 -0700 (PDT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id E1CBE81D01; Mon, 27 Aug 2001 18:28:56 -0500 (CDT) Date: Mon, 27 Aug 2001 18:28:56 -0500 From: Alfred Perlstein To: Matthew Hagerty Cc: freebsd-hackers@freebsd.org Subject: Re: To determine if a file has grown? Message-ID: <20010827182856.L81307@elvis.mu.org> References: <5.1.0.14.2.20010827185351.01ba3aa8@pop.voyager.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i 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 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Matthew Hagerty [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