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.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 0355EBC69 for ; Fri, 13 Apr 2007 09:57:55 +0200 (CEST) Received: from [128.93.11.101] (buzet.inria.fr [128.93.11.101]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3D7vt9v025284; Fri, 13 Apr 2007 09:57:55 +0200 Message-ID: <461F37F8.5030509@inria.fr> Date: Fri, 13 Apr 2007 09:57:44 +0200 From: Alain Frisch User-Agent: Thunderbird 1.5.0.10 (X11/20070306) MIME-Version: 1.0 To: Gabriel Kerneis Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] [OT?] spamoracle concurrency References: <87ps68u7ub.fsf@unicorn.ahiker.homeip.net> <461F258E.5030905@inria.fr> <20070413085621.7fbb74b3@kerneis.info> In-Reply-To: <20070413085621.7fbb74b3@kerneis.info> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 461F3803.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; frisch:01 frisch:01 renames:01 wrote:01 caml-list:01 writes:01 alain:01 alain:01 concurrency:02 descriptor:02 exists:03 inria:06 reads:06 file:08 file:08 Gabriel Kerneis wrote: > What about the following scenario : > 1) "spamoracle add" reads the database, updates it and writes it to a > fresh file > 2) "spamoracle read" begins to read the database from file > 3) "spamoracle add" renames the file > 4) "spamoracle read" finishes to read the database from file and closes > the file (which no longer exists ?) > > Is it safe ? Yes, it is. In step 4, "spamoracle read" sees the old version of the file through the already opened file descriptor. -- Alain