English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    
Browse thread
[Caml-list] input_line is blocking
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Oliver Bandel <oliver@f...>
Subject: Re: [Caml-list] input_line is blocking


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