From dd487472345cffd5b440f2e73f3244bf20a49eb7 Mon Sep 17 00:00:00 2001 From: Ross Paterson Date: Tue, 24 Jul 2007 11:40:03 +0000 Subject: [PATCH] fix Hugs implementation of openTempFile --- System/IO.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 1.7.10.4