[GHC] #3086: Exception if temp path has national symbols

GHC trac at galois.com
Thu Mar 12 01:46:01 EDT 2009


#3086: Exception if temp path has national symbols
---------------------------------+------------------------------------------
 Reporter:  Tonal                |          Owner:                  
     Type:  bug                  |         Status:  new             
 Priority:  normal               |      Milestone:                  
Component:  libraries/directory  |        Version:  6.10.1          
 Severity:  normal               |     Resolution:                  
 Keywords:                       |       Testcase:                  
       Os:  Unknown/Multiple     |   Architecture:  Unknown/Multiple
---------------------------------+------------------------------------------
Comment (by Tonal):

 see also #2963

 For fixed need add getTemporaryDirectory to System/Win32/Info.hsc:
 {{{
 diff -rN old-Win32/System/Win32/Info.hsc new-Win32/System/Win32/Info.hsc
 98a99,101
 > getTempPath :: IO String
 > getTempPath = try "GetTempPath" (flip c_getTempPath) 512
 >
 118a122,124
 > foreign import stdcall unsafe "GetTempPathW"
 >   c_getTempPath :: DWORD -> LPTSTR -> IO UINT
 >
 }}}
 And use it in System.Directories.getCurrentDirectory:
 {{{
 diff -rN old-directory/System/Directory.hs new-
 directory/System/Directory.hs
 1076,1078c1076
 <   allocaBytes long_path_size $ \pPath -> do
 <      _r <- c_GetTempPath (fromIntegral long_path_size) pPath
 <      peekCString pPath
 ---
 >   System.Win32.getTempPath
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3086#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list