Browse thread
Help interfacing with C
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2006-08-18 (14:13) |
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