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
-<http://www.opengroup.org/onlinepubs/007904975/toc.htm>), but in
+<http://www.opengroup.org/onlinepubs/009695399/>), 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.
#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"
r <- c_GetTempPath (fromIntegral long_path_size) pPath
peekCString pPath
#else
- catch (getEnv "TMPDIR") (\ex -> return "/tmp")
+ getEnv "TMPDIR"
+#if !__NHC__
+ `catch` \ex -> case ex of
+ IOException e | isDoesNotExistError e -> return "/tmp"
+ _ -> throw ex
+#else
+ `catch` (\ex -> return "/tmp")
+#endif
#endif
#if defined(mingw32_HOST_OS)