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 BAA22237; Wed, 12 Jun 2002 01:13:15 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA22179 for ; Wed, 12 Jun 2002 01:13:12 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from gogol.zorgol (Mix-Montsouris-113-4-46.abo.wanadoo.fr [80.9.111.46]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id g5BND6H00647 for ; Wed, 12 Jun 2002 01:13:07 +0200 (MET DST) Received: (qmail 17418 invoked by uid 1001); 11 Jun 2002 23:12:56 -0000 Date: Wed, 12 Jun 2002 01:12:55 +0200 From: Berke Durak To: Max Kirillov Cc: caml-list@inria.fr Subject: Re: [Caml-list] Unix.file_descr -> int ??? Message-ID: <20020612011255.A7873@gogol.zorgol> References: <20020611213158.A680@max.home> <20020611174527.A14450@pauillac.inria.fr> <20020612022611.B680@max.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020612022611.B680@max.home>; from max630@mail.ru on Wed, Jun 12, 2002 at 02:26:11AM +0700 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Jun 12, 2002 at 02:26:11AM +0700, Max Kirillov wrote: > Hello. > ... > Anyway, any meaningful type barrier is good. Maybe the > discussed too. But, since we all know that file_descr and > dir_handle are integers, could it be worthwhile to have > functions *_of_int and int_of_*? > > Max. Hi A file_descr_of_int function might seem meaningless at first, but with inheritance of descriptors under Unix, some programs are intended to be executed with a particular file descriptor configuration, eg. fd 3 is data stream, fd 4 is control, etc. OK, under Linux or BSD you can open /proc/fd/xx or /fd/xx, but that's not really standard. For the other direction, I'd suggest a "name_of_file_descr" function, which, given a file descriptor, gives a platform-dependent string, for debugging purposes. Under Unix, it could return the FD in decimal format ; under other OSes, it could return a hexadecimal pointer value. -- Berke Durak ------------------- 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