System.Directory.getTemporaryDirectory broken on Windows

"Neil Mitchell" <[email protected]> Sat, 31 Mar 2007 20:14:12 +0100
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Message-ID <[email protected]>
Hi,

getTemporaryDirectory is defined as:

getTemporaryDirectory :: IO FilePath
getTemporaryDirectory = do
#if defined(mingw32_HOST_OS)
  allocaBytes long_path_size $ \pPath -> do
     r <- c_GetTempPath (fromIntegral long_path_size) pPath
     peekCString pPath
#else
  catch (getEnv "TMPDIR") (\ex -> return "/tmp")
#endif

However, taking a look at the generated files that ship with WinHugs
Sep 2006, the code is the #else case - a catch and TMPDIR. This means
that function doesn't work on Windows properly

Any idea how this happened? I will try recompiling the libraries after
Easter. Should mingw32_HOST_OS be defined with our build system on
Windows?

Thanks

Neil