handleToFd without closing of the file descriptor

2011-01-27 Thread Volker Wysk
Hello I need to get the file descriptor, which is encapsulated inside a handle. handleToFd gets it, but the fd is closed. Is it possible to extract the fd from the handle, without modifying the handle? Greetings, Volker ___ Glasgow-haskell-users mail

handleToFd without closing of the file descriptor

2011-01-27 Thread Volker Wysk
Hello I need to get the file descriptor, which is encapsulated inside a handle. handleToFd gets it, but the fd is closed. Is it possible to extract the fd from the handle, without modifying the handle? Greetings, Volker ___ Glasgow-haskell-users mail

Re: handleToFd without closing of the file descriptor

2011-01-28 Thread Simon Marlow
On 27/01/2011 20:04, Volker Wysk wrote: I need to get the file descriptor, which is encapsulated inside a handle. handleToFd gets it, but the fd is closed. Is it possible to extract the fd from the handle, without modifying the handle? I think you mean the *Handle* is closed, not the FD, right?

Re: handleToFd without closing of the file descriptor

2011-01-30 Thread Jeremy Shaw
At line 206 of this file there is a withFd function that might suit your needs, https://patch-tag.com/r/mae/sendfile/snapshot/current/content/pretty/src/Network/Socket/SendFile/Internal.hs -- The Fd should not be used after the action returns because the -- Handler may be garbage collected and th