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=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 54B9BBC6C for ; Fri, 18 Jan 2008 01:52:10 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHeHj0eGVHfOgGdsb2JhbACQFwEBCQQGAgUKGJ0c X-IronPort-AV: E=Sophos;i="4.25,213,1199660400"; d="scan'208";a="6257311" Received: from mta-a2.tc.umn.edu ([134.84.119.206]) by mail2-smtp-roc.national.inria.fr with ESMTP; 18 Jan 2008 01:52:03 +0100 Received: from [128.101.106.92] (glu02.cs.umn.edu [128.101.106.92]) by mta-a2.tc.umn.edu (UMN smtpd) with ESMTP for ; Thu, 17 Jan 2008 18:51:57 -0600 (CST) X-Umn-Remote-Mta: [N] glu02.cs.umn.edu [128.101.106.92] #+LO+TS+AU+HN Message-ID: <478FF82D.1070305@cs.umn.edu> Date: Thu, 17 Jan 2008 18:51:57 -0600 From: Christopher Kauffman User-Agent: Thunderbird 1.5.0.14pre (X11/20071023) MIME-Version: 1.0 To: OCaml Subject: Trouble with Scanf and files Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; scanf:01 scanf:01 ocaml:01 allocates:01 buffer:01 cheers:01 garbage:01 let:03 chris:06 manual:06 encountered:07 suggested:07 attempted:08 strange:08 christopher:08 I have encountered some difficulty using Scanf with a large number of files. As suggested in the the Ocaml manual, my strategy so far when reading a number of files has been to use Scanf.Scanning.from_file to create a scanbuf for each file. I had always wondered if this would cause problems with large numbers of files because I could not figure out a way to close a file after completing operations on it. Today I attempted to process too many and received a fatal system error. If one allocates a scanbuf via let b = Scanf.Scanning.from_file "somefile" in ... is there a way to subsequently close the file when the buffer is no longer needed? Or is this an issue that should be taken care of by the garbage collector in some strange way? Cheers, Chris Kauffman