English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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