From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 70945BCA8 for ; Fri, 1 Apr 2005 01:29:04 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j2VNT3Qk023561 for ; Fri, 1 Apr 2005 01:29:04 +0200 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 BAA18119 for ; Fri, 1 Apr 2005 01:29:03 +0200 (MET DST) Received: from saul.cis.upenn.edu (SAUL.CIS.upenn.edu [158.130.12.4]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j2VNT1vh023543 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 1 Apr 2005 01:29:02 +0200 Received: from localhost (SAUL.CIS.upenn.edu [158.130.12.4]) by saul.cis.upenn.edu (8.12.10/8.12.9) with ESMTP id j2VNSuCP023097; Thu, 31 Mar 2005 18:28:56 -0500 (EST) Date: Thu, 31 Mar 2005 18:28:55 -0500 (EST) Message-Id: <20050331.182855.07449233.eijiro_sumii@anet.ne.jp> To: caml-list@inria.fr Cc: sumii@saul.cis.upenn.edu Subject: select (or polling) on in_channel? From: Eijiro Sumii X-Mailer: Mew version 3.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 424C87C0.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 424C87BD.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; polling:01 eijiro:01 sumii:01 eijiro:01 sumii:01 pervasives:01 buffering:01 pervasives:01 low-level:01 upenn:01 ...:98 unix:01 unix:01 functions:01 descr:02 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: Hi again... Is there any easy way to _correctly_ do a "select" (as in the UNIX system call) on Pervasives.in_channel? My naive approach Unix.select [Unix.descr_of_in_channel ic] [] [] 0. seems to fail (and it indeed does fail) because of the buffering inside Pervasives.in_channel, as long as I checked the source code of ocaml-3.08.3. Pervasives.in_channel_length doesn't help in my case since the input channel is not a file. Should I use only the low-level functions in the Unix module if I _ever_ want "select"? Thanks, -- Eijiro Sumii (http://www.cis.upenn.edu/~sumii/) Department of Computer and Information Science, University of Pennsylvania