fix Hugs implementation of openTempFile
authorRoss Paterson <ross@soi.city.ac.uk>
Tue, 24 Jul 2007 11:40:03 +0000 (11:40 +0000)
committerRoss Paterson <ross@soi.city.ac.uk>
Tue, 24 Jul 2007 11:40:03 +0000 (11:40 +0000)
System/IO.hs

index c8b0f92..a5b9d7d 100644 (file)
@@ -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