System.Directory.getTemporaryDirectory broken on Windows

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


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


More information about the Hugs-Bugs mailing list