System.Directory.getTemporaryDirectory broken on Windows

Neil Mitchell ndmitchell at
Sat Mar 31 15:14:12 EDT 2007


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
  catch (getEnv "TMPDIR") (\ex -> return "/tmp")

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



More information about the Hugs-Bugs mailing list