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 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 36FF3BC69 for ; Thu, 23 Aug 2007 19:07:48 +0200 (CEST) Received: from chokecherry.srv.cs.cmu.edu (CHOKECHERRY.SRV.CS.CMU.EDU [128.2.185.41]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7NH7kaM014033 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 23 Aug 2007 19:07:47 +0200 Received: from stratocaster.home (c-71-206-252-35.hsd1.pa.comcast.net [71.206.252.35]) (authenticated bits=0) by chokecherry.srv.cs.cmu.edu (8.13.6/8.13.6) with ESMTP id l7NH7fKI004181 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Thu, 23 Aug 2007 13:07:43 -0400 (EDT) Received: from ecc by stratocaster.home with local (Exim 4.67) (envelope-from ) id 1IOG9l-0006eh-8L for caml-list@yquem.inria.fr; Thu, 23 Aug 2007 13:07:41 -0400 Date: Thu, 23 Aug 2007 13:07:41 -0400 From: Eric Cooper To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] commands.getoutput () in ocaml? Message-ID: <20070823170741.GB25117@stratocaster.home> Mail-Followup-To: caml-list@yquem.inria.fr References: <28fa90930708221256t497e8356k84861abd6b2e91b8@mail.gmail.com> <95513600708221535t7508e900h192554da73d37fcf@mail.gmail.com> <20070822230418.GC10505@stratocaster.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-11) X-Miltered: at discorde with ID 46CDBEE2.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 buffer:01 pervasives:01 fires:98 wrote:01 caml-list:01 tail:01 benjamin:01 data:02 incomplete:03 bytes:03 eof:04 size:95 succeeds:06 channel:06 On Wed, Aug 22, 2007 at 11:03:42PM -0500, Dave Benjamin wrote: > However, this doesn't work unless I set buffer_size to 1. Otherwise, the > End_of_file fires before all the data is read in, so I either get nothing > or an incomplete result. Since you can't use Pervasives.in_channel_length on a pipe, the only way I see is to write a special add_channel_tail function, called only when you catch the first Eof, that tries successively to add_channel n, n-1, n-2, ... etc. bytes until it succeeds. Sigh. -- Eric Cooper e c c @ c m u . e d u