X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FDirectory.hs;h=d705c0d27ed711f3bb881fd0b87b33015e58c4d9;hb=29fd272657d1c13500e7cd5f670aadc8ed41c445;hp=d5d54e82a216c1a808df820ddf2fd871b1042608;hpb=1f866f6625c7ed42b34bf1c77e0f0dddd5280315;p=haskell-directory.git diff --git a/System/Directory.hs b/System/Directory.hs index d5d54e8..d705c0d 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -101,7 +101,7 @@ A directory contains a series of entries, each of which is a named reference to a file system object (file, directory etc.). Some entries may be hidden, inaccessible, or have some administrative function (e.g. `.' or `..' under POSIX -), but in +), but in this standard all such entries are considered to form part of the directory contents. Entries in sub-directories are not, however, considered to form part of the directory contents. @@ -584,7 +584,9 @@ canonicalizePath fpath = #else do c_realpath pInPath pOutPath #endif - peekCString pOutPath + path <- peekCString pOutPath + return (normalise path) + -- normalise does more stuff, like upper-casing the drive letter #if defined(mingw32_HOST_OS) foreign import stdcall unsafe "GetFullPathNameA" @@ -1025,7 +1027,10 @@ getTemporaryDirectory = do r <- c_GetTempPath (fromIntegral long_path_size) pPath peekCString pPath #else - catch (getEnv "TMPDIR") (\ex -> return "/tmp") + getEnv "TMPDIR" + `catch` \ex -> case ex of + IOException e | isDoesNotExistError e -> return "/tmp" + _ -> throw ex #endif #if defined(mingw32_HOST_OS)