From: Simon Marlow Date: Thu, 12 Mar 2009 16:14:08 +0000 (+0000) Subject: FIX #3086: use System.Win32.getTemporaryDirectory X-Git-Tag: 2009-06-25~11 X-Git-Url: http://git.megacz.com/?p=haskell-directory.git;a=commitdiff_plain;h=5f753ccb8ebe2a630aaf7da2399565547d006d49;hp=9ba6942c1da0e671cd51795a4d31edd34b2f755a FIX #3086: use System.Win32.getTemporaryDirectory --- diff --git a/System/Directory.hs b/System/Directory.hs index ec79997..1f38b14 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -1073,9 +1073,7 @@ The function doesn\'t verify whether the path exists. 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 + System.Win32.getTemporaryDirectory #else getEnv "TMPDIR" #if !__NHC__ @@ -1099,8 +1097,6 @@ foreign import ccall unsafe "__hscore_CSIDL_APPDATA" csidl_APPDATA :: CInt foreign import ccall unsafe "__hscore_CSIDL_WINDOWS" csidl_WINDOWS :: CInt foreign import ccall unsafe "__hscore_CSIDL_PERSONAL" csidl_PERSONAL :: CInt -foreign import stdcall unsafe "GetTempPathA" c_GetTempPath :: CInt -> CString -> IO CInt - raiseUnsupported :: String -> IO () raiseUnsupported loc = ioException (ioeSetErrorString (mkIOError UnsupportedOperation loc Nothing Nothing) "unsupported operation")