From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 74B73BC69 for ; Wed, 24 Oct 2007 14:55:05 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAI/dHkdQRFuw/2dsb2JhbAA X-IronPort-AV: E=Sophos;i="4.21,324,1188770400"; d="scan'208";a="5049782" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 24 Oct 2007 14:55:05 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l9OCt4iq019610 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 24 Oct 2007 14:55:04 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAI/dHkdQRFuw/2dsb2JhbAA X-IronPort-AV: E=Sophos;i="4.21,324,1188770400"; d="scan'208";a="5049781" Received: from furbychan.cocan.org ([80.68.91.176]) by mail3-smtp-sop.national.inria.fr with ESMTP; 24 Oct 2007 14:55:04 +0200 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1IkflB-0003Pj-00; Wed, 24 Oct 2007 13:54:57 +0100 Date: Wed, 24 Oct 2007 13:54:57 +0100 To: Karl Zilles Cc: Orlin Grigorov , caml-list@inria.fr Subject: Re: [Caml-list] How to monitor a specific file for changes Message-ID: <20071024125457.GB12110@furbychan.cocan.org> References: <20071023052001.517e957e.mle+ocaml@mega-nerd.com> <471CFD24.30805@1969web.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <471CFD24.30805@1969web.com> User-Agent: Mutt/1.5.9i From: Richard Jones X-Miltered: at discorde with ID 471F40A8.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; wrote:01 wrote:01 caml-list:01 red:92 stat:07 stat:07 it'll:09 file:11 file:11 directory:11 poll:12 changes:12 think:13 version:13 issue:14 On Mon, Oct 22, 2007 at 12:42:28PM -0700, Karl Zilles wrote: > Orlin Grigorov wrote: > >Oh, here's another idea---every certain amount of time, I just compare > >my last saved version of the file to the current one---if different, > >there's my event. What do you think? > > Just stat it. You can stat it every second and never notice any > performance issue. In fact you can stat a whole directory of files > every second and never notice. It'll work cross platform, and it's easy: /me weeps. Please don't do this. Processes which regularly poll are a bane for people who are working to reduce the power consumption of laptops and servers. Rich. -- Richard Jones Red Hat