Version française
Home     About     Download     Resources     Contact us    
Browse thread
Help interfacing with C
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Olivier Andrieu <oandrieu@n...>
Subject: Re: [Caml-list] Re: Help interfacing with C
 Bardur Arantsson [Thursday 17 August 2006] :
 >
 > Nathaniel Gray wrote:
 > > Hi folks,
 > [--snip--]
 > > have select work on (file_descr * 'a) pairs instead of plain file
 > > descriptors.
 > 
 > It's much easier than that; just define a conversion in OCaml:
 > 
 >     external file_descr_to_int : file_descr -> int = "%identity";
 >     external int_to_file_descr : int -> file_descr = "%identity";

That will only work on Unix: on Windows, a file_descr is not an int
but a custom block.

file_descr work fine as keys for a Hashtbl though.

-- 
   Olivier