From: Ross Paterson Date: Tue, 24 Jul 2007 11:40:03 +0000 (+0000) Subject: fix Hugs implementation of openTempFile X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=dd487472345cffd5b440f2e73f3244bf20a49eb7;p=ghc-base.git fix Hugs implementation of openTempFile --- diff --git a/System/IO.hs b/System/IO.hs index c8b0f92..a5b9d7d 100644 --- a/System/IO.hs +++ b/System/IO.hs @@ -155,7 +155,7 @@ module System.IO ( hGetBufNonBlocking, -- :: Handle -> Ptr a -> Int -> IO Int #endif - -- * Temporary files (not portable: GHC only) + -- * Temporary files openTempFile, openBinaryTempFile, @@ -464,6 +464,9 @@ openTempFile' loc tmp_dir template binary = do where filename = prefix ++ show x ++ suffix filepath = tmp_dir ++ [pathSeparator] ++ filename +#if __HUGS__ + fdToHandle fd = openFd (fromIntegral fd) False ReadWriteMode binary +#endif -- XXX Should use filepath library pathSeparator :: Char