From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id GAA05848; Fri, 24 Jan 2003 06:06:46 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id GAA05899 for ; Fri, 24 Jan 2003 06:06:44 +0100 (MET) Received: from plover.atdesk.com ([204.130.247.254]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h0O56hv24409 for ; Fri, 24 Jan 2003 06:06:44 +0100 (MET) Received: from explicit.atdesk.com (explicit.atdesk.com [172.30.40.54]) by plover.atdesk.com (8.11.6/8.11.6) with ESMTP id h0O56g302990 for ; Fri, 24 Jan 2003 00:06:43 -0500 To: caml-list@inria.fr Subject: [Caml-list] file descriptors as integers? From: Chris Uzdavinis Organization: Automated Trading Desk, LLC Date: 24 Jan 2003 00:06:42 -0500 Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk The Unix module publishes the type "file_descr" as an abstract type. This makes it difficult to use file descriptors in some (IMHO) useful ways. When I manage a large number of descriptors, an efficient technique to is to use the descriptor as the index into an array of per-connection data structures. But since the descriptor is abstract, I cannot use it as an integer to do this. I know I can use hash-tables in ocaml to create a similar relationship between (fd,data) but it is less efficient. Is there any kind of interface to get the integral value of a file descriptor, or perhaps a more encapsulated way to accomplish a similar result? Thank you. -- Chris ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners