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 CAA02483; Mon, 10 Nov 2003 02:16:41 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA02535 for ; Mon, 10 Nov 2003 02:16:41 +0100 (MET) Received: from war.OCF.Berkeley.EDU (war.OCF.Berkeley.EDU [192.58.221.244]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hAA1Gd129298 for ; Mon, 10 Nov 2003 02:16:40 +0100 (MET) Received: from phirelord (async@bow-108-172.Reshall.Berkeley.EDU [169.229.108.172]) by war.OCF.Berkeley.EDU (8.12.10/8.9.3) with SMTP id hAA1Gcw6013961 for ; Sun, 9 Nov 2003 17:16:38 -0800 (PST) Date: Sun, 9 Nov 2003 17:16:38 -0800 From: Michael Hoisie To: caml-list@pauillac.inria.fr Subject: [Caml-list] Arbitrarily throwing End_of_file Message-Id: <20031109171638.42cd6807.mbh@ocf.berkeley.edu> Organization: UC Berkeley X-Mailer: Sylpheed version 0.9.3claws (GTK+ 1.2.10; i386-portbld-freebsd4.9) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; arbitrarily:01 printf:01 printf:01 3.07:01 -mike:01 rec:01 ocf:03 let:04 let:04 seems:05 str:05 throwing:07 i'm:07 michael:08 function:09 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I have a file which is approximately 278,440 lines of text (more specifically, it is the result of doing 'ls -lAR /') I was trying to write this relatively simple program to analyze it but it seems that End_of_file was thrown very early. To test, it, I made a simple function: let rec count_lines file n = try let str = input_line file in count_lines file (n + 1) with End_of_file -> Printf.printf "The file is %d\n lines long" n and ran it with something like: let file = open_in "longfile.dat" in count_lines file 0 The result was 26187. count_lines is a stripped-down version of the original function i used to analyze the file. If I used the original, it threw an End_of_file at line 23806. I'm running 3.07+2 on FreeBSD 4.9 any suggestions? -mike ------------------- 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