From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA03310; Wed, 7 Aug 2002 13:40:59 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA03220 for ; Wed, 7 Aug 2002 13:40:58 +0200 (MET DST) Received: from waco.inria.fr (waco.inria.fr [128.93.25.2]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g77Bee506324; Wed, 7 Aug 2002 13:40:40 +0200 (MET DST) Received: (from verlyck@localhost) by waco.inria.fr (8.11.1/8.11.1) id g77Bee528601; Wed, 7 Aug 2002 13:40:40 +0200 Date: Wed, 7 Aug 2002 13:40:40 +0200 Message-Id: <200208071140.g77Bee528601@waco.inria.fr> X-Authentication-Warning: waco.inria.fr: verlyck set sender to Bruno.Verlyck@inria.fr using -f To: stein@eecs.harvard.edu CC: andrieu@ijm.jussieu.fr, mtucker@eecs.harvard.edu, caml-list@inria.fr In-reply-to: (stein@eecs.harvard.edu) Subject: Re: [Caml-list] Sharing Files between OCaml and C From: Bruno.Verlyck@inria.fr References: Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: text/plain; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Date: Tue, 6 Aug 2002 14:50:44 -0400 (EDT) From: Lex Stein On POSIX compliant systems, dup() does not, in fact, create a new vnode for a file. It merely creates a new file descriptor table entry (in the process's in-kernel descriptor table) that points to exactly the same vnode. The two descriptors share the same buffered blocks in the global buffer cache. The problem I was alluding to is a local (inside the Caml process) buffering one: the Caml runtime doesn't use C stdio, and has its own buffering scheme. As the original poster told us about FILE * and channels, I assumed he would mix I/O on channels and FILE * pointing to the same file. Then he has to be cautious. Bruno. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners