From fe5420ba0484d7a0937ec3a1153bd9b41967a803 Mon Sep 17 00:00:00 2001 From: "sven.panne@aedion.de" Date: Sun, 2 Sep 2007 12:55:21 +0000 Subject: [PATCH] Fixed permission setting in copyFile Copy the permissions to the *temporary* file before moving it, no to the probably non-existing real destination file. Before this fix, "try" silently wiped this bug under the carpet, leading to silently broken permissions. --- System/Directory.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/System/Directory.hs b/System/Directory.hs index e7affb6..c3698a2 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -553,7 +553,7 @@ copyFile fromFPath toFPath = bracketOnError openTmp cleanTmp $ \(tmpFPath, hTmp) -> do allocaBytes bufferSize $ copyContents hFrom hTmp hClose hTmp - try (copyPermissions fromFPath toFPath) + try (copyPermissions fromFPath tmpFPath) renameFile tmpFPath toFPath openTmp = openBinaryTempFile (takeDirectory toFPath) ".copyFile.tmp" cleanTmp (tmpFPath, hTmp) = do try $ hClose hTmp -- 1.7.10.4