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 SAA32727; Sun, 27 Jun 2004 18:21:27 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 SAA00156 for ; Sun, 27 Jun 2004 18:21:26 +0200 (MET DST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i5RGLNSH031706 for ; Sun, 27 Jun 2004 18:21:24 +0200 Received: from [192.168.1.200] (ppp217-185.lns1.syd3.internode.on.net [203.122.217.185]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i5RGLJHY094560 for ; Mon, 28 Jun 2004 01:51:20 +0930 (CST) Subject: [Caml-list] file close bug? From: skaller Reply-To: skaller@users.sourceforge.net To: caml-list Content-Type: text/plain Message-Id: <1088353277.32642.28.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 28 Jun 2004 02:21:19 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 40DEF403.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; bug:01 sourceforge:01 marshalled:01 hashtable:01 ctrl-c:01 marshalled:01 flushing:01 9660:01 glebe:01 bin:01 ocaml:01 nsw:01 polymorphic:01 marshal:01 snail:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk The following code has worked for some time: try (* to write Marshalled parse tree out *) let x = open_out_bin pf in Marshal.to_channel x (this_version,sts) []; close_out x with _ -> () (* can't write, don't worry *) Now, I have modified my program to use some specialised hashtable types using address comparisons on part of the keys. My largest test case now fails to terminate (weird!, it worked before with polymorphic comparison ..) but I can kill it with Ctrl-C. What's weird is that if I rerun it, it tries to reload the Marshalled data above, and gets an End_of_file error, indicating the whole file was not written out. However,when I run another program which doesn't get up to the use of the new hashtbles, and so terminates, the whole file *is* being correctly written out (by the same piece of code). This looks like a flushing/closing problem in Ocaml? [Just because the program aborted should not prevent a *closed* file's buffers being written to disk ..] There's been some talk about this in other circumstances? Is this a known problem? -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- 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