X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FDirectory.hs;fp=System%2FDirectory.hs;h=3455f4d3b6d5fa59d8ba56a3749167a015c0797b;hb=7df5ce8c539a826a78249fa0688c05dd9f301214;hp=86e852fa97386298386b91c77a87a47189d82dfa;hpb=2e03cbca61ec6ebb202f56b48287fe60d65f600e;p=haskell-directory.git diff --git a/System/Directory.hs b/System/Directory.hs index 86e852f..3455f4d 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -629,15 +629,14 @@ copyFile fromFPath toFPath = -- attempt. canonicalizePath :: FilePath -> IO FilePath canonicalizePath fpath = - withCString fpath $ \pInPath -> - allocaBytes long_path_size $ \pOutPath -> #if defined(mingw32_HOST_OS) - alloca $ \ppFilePart -> - do c_GetFullPathName pInPath (fromIntegral long_path_size) pOutPath ppFilePart + do path <- System.Win32.getFullPathName fpath #else + withCString fpath $ \pInPath -> + allocaBytes long_path_size $ \pOutPath -> do c_realpath pInPath pOutPath -#endif path <- peekCString pOutPath +#endif return (normalise path) -- normalise does more stuff, like upper-casing the drive letter