From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id B6F4ABB81 for ; Mon, 10 Apr 2006 17:28:18 +0200 (CEST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.176]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k3AFSG9M031500 for ; Mon, 10 Apr 2006 17:28:18 +0200 Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1FSyJJ-0001nq-00; Mon, 10 Apr 2006 17:28:13 +0200 Received: from [84.58.138.225] (helo=gate.lan.gerd-stolpmann.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1FSyJJ-0000g8-00; Mon, 10 Apr 2006 17:28:13 +0200 Received: from flakew.lan.gerd-stolpmann.de (flakew.lan.gerd-stolpmann.de [192.168.0.32]) by gate.lan.gerd-stolpmann.de (Postfix) with ESMTP id 3FB28C07E; Mon, 10 Apr 2006 17:28:13 +0200 (CEST) Subject: Re: [Caml-list] really_input won't read in an entire file... From: Gerd Stolpmann To: Jonathan Roewen Cc: OCaml In-Reply-To: References: Content-Type: text/plain Date: Mon, 10 Apr 2006 17:28:12 +0200 Message-Id: <1144682892.10754.6.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:a6865a839c0178d9aa0ce41878507ea2 X-Miltered: at concorde with ID 443A7990.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; gerd:01 stolpmann:01 toplevel:01 binary:01 val:01 abstr:01 val:01 buf:01 buf:01 beginner's:01 ocaml:01 beginners:01 bug:01 gerd:01 stolpmann:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Am Samstag, den 08.04.2006, 22:58 +1200 schrieb Jonathan Roewen: > Hi, > > Here's an example running in the toplevel, which doesn't seem to work: > > # let ic = open_in "C:/texture.raw";; Use open_in_bin. Looks like a text/binary mode problem. > val ic : in_channel = > # let len = in_channel_length ic;; > val len : int = 196608 > # let buf = String.create len;; > val buf : string = .... > # really_input ic buf 0 len;; > Exception: End_of_file. > > Is reading it chunk-by-chunk the only reliable way to read in an > entire file? Seems fairly useless to me... > > Jonathan > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Phone: +49-6151-153855 Fax: +49-6151-997714 ------------------------------------------------------------