From 89157bc0d9b1b3786dcc07a81265f737aa8dd176 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 21 Dec 2015 05:50:19 +0100 Subject: [PATCH] LIB: fix IOError in copyFile The destination file does not exist yet so we cannot canonicalize it's full path, only part of it. --- src/IO/File.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/IO/File.hs b/src/IO/File.hs index f9c40b0..bb4d0e1 100644 --- a/src/IO/File.hs +++ b/src/IO/File.hs @@ -205,7 +205,8 @@ copyFile :: FilePath -- ^ source file -> IO () copyFile from' to' = do from <- canonicalizePath from' - to <- canonicalizePath to' + tod <- canonicalizePath (baseDir to') + let to = tod takeFileName to' fileSanityThrow from throwNotAbsolute to throwDirDoesExist to