
tis 2003-05-27 klockan 10.42 skrev Martin Norbäck:
tis 2003-05-27 klockan 09.20 skrev Volker Stolz:
In local.libraries, you wrote:
I needed a function for creating temporary files. Since I couldn't find one in the standard library, I just hacked one up using the ffi. It's in the haskell-libs cvs [1]. I've got an icky import of GHC.Handle to get openFd, any way I could get rid of it? (fdToHandle isn't enough)
It's in the Posix Spec, so we might as well put it in System.Posix.
Yes, and perhaps you want to return (String, Handle) so that you know the file name (in case you want to do something else than just reading/writing from it).
Well, I peek at the CString and use that as the file name when creating the Handle. I assumed that there was a way to get this from the Handle (other than the Show instance that is). Maybe there isn't? /Martin -- Martin Sjögren sjogren@debian.org -- marvin@dum.chalmers.se GPG key: http://www.mdstud.chalmers.se/~md9ms/gpg.html let hello = "hello" : hello in putStr (unlines hello)