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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
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

Dave