Getting the file descriptor from a handle, without closing it

2011-10-01 Thread Volker Wysk
Hello! I need to get the file descriptors of some handles, but the handles should not be modified. They should not be closed by the operation. I guess, that the handle gets closed for a reason. But I'm using the revealed file descriptors in a way which should pose no problems for the integrity

Re: Getting the file descriptor from a handle, without closing it

2011-10-01 Thread Volker Wysk
On Saturday 01 October 2011 08:30:40 Volker Wysk wrote: If anyone can point out to me, how this non-blocking handleToFd function should be made, I would be grateful. This should be non-CLOSING handleToFd function. Sorry. Volker ___

Re: Getting the file descriptor from a handle, without closing it

2011-10-01 Thread Bas van Dijk
On 1 October 2011 08:30, Volker Wysk p...@volker-wysk.de wrote: 1. data FD = FD {  fdFD :: {-# UNPACK #-} !CInt,  fdIsNonBlocking :: {-# UNPACK #-} !Int  } What is that exclamation mark? That's a strictness annotation and is haskell98/2010:

REQ: add a non-closing version of handleToFd

2011-10-01 Thread Volker Wysk
Hello The function to extract a file descriptor from a handle, handleToFd, closes the handle as a side effect. This appears to be necessary in the general case, otherwise the implementers wouldn't have made it this way. But there are cases in which it isn't necessary to close the handle. For

mkTopLevEnv: not interpreted main:Main

2011-10-01 Thread Chris Smith
So I'm trying to fix a bug in a web application that's using the GHC API with GHC 7.2. If it helps, the application is gloss-web, source code at https://github.com/cdsmith/gloss-web and the relevant module is src/Source.hs. The error I'm getting is no location info: mkTopLevEnv: not