From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL,HTML_MESSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 68EF7BB84 for ; Tue, 1 Jul 2008 16:56:33 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao4AAKXiaUjZkrEEfGdsb2JhbACCPDaPPAEBCwUCBgcRA586 X-IronPort-AV: E=Sophos;i="4.27,732,1204498800"; d="scan'208,217";a="26910523" Received: from web27004.mail.ukl.yahoo.com ([217.146.177.4]) by mail4-smtp-sop.national.inria.fr with SMTP; 01 Jul 2008 16:56:32 +0200 Received: (qmail 15287 invoked by uid 60001); 1 Jul 2008 14:56:32 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=nhjX0/2yZIACip/rwlZi6H2GfSeUfSoDo+Pxb6IygYrbWfyS8nceYkDhBuMfoR2jA2V2G7NgA4EwKV49hHUsr9uJZ/pTn96iu8a0CbOiMgLc0EZHojEkCydLQkrOrj6hRN8BlJs2n+GApqgjvCVlKRAjVJRgW3i4iuy0t8Onfpw=; Received: from [193.52.94.40] by web27004.mail.ukl.yahoo.com via HTTP; Tue, 01 Jul 2008 14:56:31 GMT X-Mailer: YahooMailRC/975.45 YahooMailWebService/0.7.199 Date: Tue, 1 Jul 2008 14:56:31 +0000 (GMT) From: Matthieu Wipliez Subject: Re : [Caml-list] file_desc To: Robert Fischer , caml-list MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-752726167-1214924191=:10326" Message-ID: <976118.10326.qm@web27004.mail.ukl.yahoo.com> X-Spam: no; 0.00; matthieu:01 desc:01 desc:01 ocaml:01 struct:01 filedescr:01 filedescr:01 val:01 unixsupport:01 matthieu:01 beginner's:01 ocaml:01 bug:01 struct:01 val:01 X-Attachments: cset="utf-8" cset="utf-8" --0-752726167-1214924191=:10326 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ----- Message d'origine ----=0A> De : Robert Fischer =0A> =C3=80 : caml-list =0A> Envoy=C3= =A9 le : Mardi, 1 Juillet 2008, 16h35mn 53s=0A> Objet : [Caml-list] file_de= sc=0A> =0A> Is there a way to convert a file_descr to/from an int in OCaml?= The type is =0A> abstract, and there=0A> doesn't seem to be an obvious an= swer.=0A=0AIt is defined in the Unix module as an int. Perhaps some Obj.mag= ic can do the trick?=0A=0AFor Windows however things are more complicated, = because a file_descr is a "struct filedescr" value. It is possible to obtai= n an int from this using the win_CRT_fd_of_filedescr function or the CRT_fd= _val(v) macro, both defined in unixsupport.h.=0AI think you can either use = Obj.field or write a C function (basically calling win_CRT_fd_of_filedescr)= to access this information.=0A=0A> =0A> Alternatively, is there a way to g= et at an inherited file_descr from a process I =0A> execv'd into?=0A=0AHowe= ver I don't know about that :D=0A=0A> =0A> ~~ Robert.=0A=0AMatthieu=0A=0A> = =0A> _______________________________________________=0A> Caml-list mailing = list. Subscription management:=0A> http://yquem.inria.fr/cgi-bin/mailman/li= stinfo/caml-list=0A> Archives: http://caml.inria.fr=0A> Beginner's list: ht= tp://groups.yahoo.com/group/ocaml_beginners=0A> Bug reports: http://caml.in= ria.fr/bin/caml-bugs=0A=0A=0A=0A _____________________________________= ________________________________________ =0AEnvoyez avec Yahoo! Mail. Une b= oite mail plus intelligente http://mail.yahoo.fr --0-752726167-1214924191=:10326 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
----- Message d'origine ----
> De : Robert Fisch= er <robert.fischer@smokejumperit.com>
> =C3=80 : caml-list <= caml-list@yquem.inria.fr>
> Envoy=C3=A9 le : Mardi, 1 Juillet 2008= , 16h35mn 53s
> Objet : [Caml-list] file_desc
>
> I= s there a way to convert a file_descr to/from an int in OCaml?  The ty= pe is
> abstract, and there
> doesn't seem to be an obvious an= swer.

It is defined in the Unix module as an int. Perhaps some Obj.m= agic can do the trick?

For Windows however things are more complicat= ed, because a file_descr is a "struct filedescr" value. It is possible to o= btain an int from this using the win_CRT_fd_of_filedescr function or the CR= T_fd_val(v) macro, both defined in unixsupport.h.
I think you can either= use Obj.field or write a C function (basically calling win_CRT_fd_of_filedescr= ) to access this information.

>
> Alternatively, is there = a way to get at an inherited file_descr from a process I
> execv'd i= nto?

However I don't know about that :D

>
> ~~ Robe= rt.

Matthieu

>
> __________________________________= _____________
> Caml-list mailing list. Subscription management:
&= gt; http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archiv= es: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/g= roup/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bug= s

=0A=0A=0A
=0AEnvoy=C3=A9 avec Yah= oo! Mail.
Une boite mail plus intelligente. --0-752726167-1214924191=:10326--