Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] calling telnet from a caml program
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-11-06 (19:51)
From: David Brown <caml-list@d...>
Subject: Re: [Caml-list] calling telnet from a caml program
On Wed, Nov 06, 2002 at 06:39:14PM +0100, Nicolas George wrote:

> Le sextidi 16 brumaire, an CCXI, Andrei Errapart a ?crit?:
> > If it is possible in C, then it is possible in OCaml, too. Most 
> > probably some termios(3) calls are needed, but not much more.

> There is nothing impossible, but there are horripilating portability
> problems here.

The CDK contains an mlexpect program, which, if it works, should do

However, what is it you are trying to do with the "telnet" protocol.
For the most part, telnet is just a simple connection to a port.
Unix.open_connection will probably do exactly what you want, just make
sure you get flushing working.

If you need to deal with the tty management functionality of telnet (say
for something interactive) that will take a bit more work.

Dave Brown