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 VAA18955; Tue, 11 Jun 2002 21:28:58 +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 VAA18899 for ; Tue, 11 Jun 2002 21:28:57 +0200 (MET DST) Received: from ntlg.sibnet.ru (dns.sibnet.ru [217.70.96.34]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g5BJSrH25530 for ; Tue, 11 Jun 2002 21:28:55 +0200 (MET DST) Received: from sibnet.ru (tlg5-ppp28.sibnet.ru [217.70.97.29]) by ntlg.sibnet.ru (8.9.3+Sun/8.9.3) with ESMTP id XAA22161 for ; Tue, 11 Jun 2002 23:28:48 +0400 (MSD) Received: by sibnet.ru id m17HrHP-001En5C; Wed, 12 Jun 2002 02:26:11 +0700 (NOVST) Date: Wed, 12 Jun 2002 02:26:11 +0700 From: Max Kirillov To: caml-list@inria.fr Subject: Re: [Caml-list] Unix.file_descr -> int ??? Message-ID: <20020612022611.B680@max.home> Mail-Followup-To: caml-list@inria.fr References: <20020611213158.A680@max.home> <20020611174527.A14450@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020611174527.A14450@pauillac.inria.fr>; from xavier.leroy@inria.fr on Tue, Jun 11, 2002 at 05:45:27PM +0200 X-Sender: Max Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello. I was trying to trace a code with some significant amount of select'ed fds. At some point, I faced the fact that I just have no way to "show" a descriptor value. That was a real shock. At the moment, the bug is found and fixed deductively, but the question remains. I know almost nothing about win32, but I was very surprised to discover that win32 has functions, isomorphic to low-level unix calls. However, I suspect (I don't have win32 headers to look in just now) that HANDLE is again a "typedef" of intteger. The abstraction is good for a higher-level portable api, which would use posix or win32 functions in background, depending on platform. I thought it to be a function "open_connection" and so on. Now I'm happy to see that usual "unix" functions would work well in win32. 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. On Tue, Jun 11, 2002 at 05:45:27PM +0200, Xavier Leroy wrote: <...> > Well, because file descriptors are an abstract data type. > What makes you think that they are integers? None of the integer > operations make any sense on file descriptors, e.g. adding or > multiplying two file descriptors. > > It is true that under Unix, file descriptors happen to be implemented > as integers, but that's purely accidental. E.g. under Windows, > Unix.file_descr is not implemented by integers. <...> > - Xavier Leroy > ------------------- ------------------- 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