How to get the file descriptor of a handle?

2010-02-13 Thread Volker Wysk
Hello I'd like to know how you get the file descriptor, which is incapsulated in a handle. The libraries GHC.IO.Handle/GHC.IO.Handle.FD only provide for the other direction. The function haFD, which I've used before I've updated to the current version of GHC (6.12), appears to be in use two

Re: How to get the file descriptor of a handle?

2010-02-13 Thread Jeremy Shaw
Hello, In GHC 6.12 there is no guarantee that a Handle is backed up by a file descriptor. That said, check out the handleToFd defined on line 141 here: http://patch-tag.com/r/mae/sendfile/snapshot/current/content/pretty/src/Network/Socket/SendFile/Internal.hs A better type might be: