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
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-07-01 (15:15)
From: Dave Benjamin <dave@r...>
Subject: Re: [Caml-list] file_desc
Robert Fischer wrote:
> Is there a way to convert a file_descr to/from an int in OCaml?  The type is abstract, and there
> doesn't seem to be an obvious answer.

If you don't want to use Obj.magic, there is also the Netsys module from 
Ocamlnet, which defines these two functions as C extensions:

     val int_of_file_descr : Unix.file_descr -> int
     val file_descr_of_int : int -> Unix.file_descr