Browse thread
[Caml-list] Unix.file_descr -> int ???
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Xavier Leroy <xavier.leroy@i...> |
| Subject: | Re: [Caml-list] Unix.file_descr -> int ??? |
> Suddently, I'm unable to recover file descriptor from Unix's > file_descr. At least, Unix module does not contain any > function doing that and the type is abstract. > What was a reason for the limitaion? 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. > Is there some way (apart from hacking ocaml) to do that? Within well-typed code, no. With typing hacks, yes. But what would you want to do this? - 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