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 QAA02610; Fri, 3 May 2002 16:25:11 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 QAA02629 for ; Fri, 3 May 2002 16:25:10 +0200 (MET DST) Received: from hirsch.in-berlin.de (hirsch.in-berlin.de [192.109.42.6]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g43EP8X19559 for ; Fri, 3 May 2002 16:25:08 +0200 (MET DST) Received: from hirsch.in-berlin.de (localhost [127.0.0.1]) by hirsch.in-berlin.de (8.12.1/8.12.1/Debian -2) with ESMTP id g43EP3H0026270 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT); Fri, 3 May 2002 16:25:03 +0200 Received: (from uucp@localhost) by hirsch.in-berlin.de (8.12.1/8.12.1/Debian -2) with UUCP id g43EP2ZA026242; Fri, 3 May 2002 16:25:02 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: caml-list@inria.fr Received: from localhost (oliver@localhost) by first.in-berlin.de (8.7.6/8.7.3) with SMTP id QAA00590; Fri, 3 May 2002 16:13:21 +0200 Date: Fri, 3 May 2002 16:13:21 +0200 (MET DST) From: Oliver Bandel To: Warp cc: OCaml Subject: Re: [Caml-list] input_line is blocking In-Reply-To: <001101c1f29c$98e4b570$5000a8c0@warp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 3 May 2002, Warp wrote: > Hi > I'm running "ocamlc" by using Unix.open_process_full in order to write an > automatic compiler. > Right now, it's working fine, but I got now a problem with input_line : > > after running open_process_full , i'm first reading all its stdout lines of > the process until End_of_file is raised, then all its stderr lines using the > same function. > > It has work fine for few weeks now, but now I found that in some cases > input_line will block, not raising End_of_file. In networking-applications, or when using pipes you can't use C's standard-lib and have to use the Unix-API directly (open/read/write/close). Ocaml's libraries seem to be wrapping C's standard-lib for it's normal I/O and the Unix-API for it's Unix-module. So, if you want to use pipes/sockets, you have to use the Unix-module's I/O-functions! But I think in Ocaml it is not a problem to write wrapper-code. In C this would be much effort, but I think in Ocaml it's easy to write a network-lib.... Ciao, Oliver ------------------- 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