Commit 89b3da21 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

'writeFileAtomic': use default permissions.

Fixes #2078.
parent 1f41dbf1
...@@ -155,7 +155,7 @@ import System.FilePath ...@@ -155,7 +155,7 @@ import System.FilePath
import System.Directory import System.Directory
( createDirectory, renameFile, removeDirectoryRecursive ) ( createDirectory, renameFile, removeDirectoryRecursive )
import System.IO import System.IO
( Handle, openFile, openBinaryFile, openBinaryTempFile ( Handle, openFile, openBinaryFile, openBinaryTempFileWithDefaultPermissions
, IOMode(ReadMode), hSetBinaryMode , IOMode(ReadMode), hSetBinaryMode
, hGetContents, stderr, stdout, hPutStr, hFlush, hClose ) , hGetContents, stderr, stdout, hPutStr, hFlush, hClose )
import System.IO.Error as IO.Error import System.IO.Error as IO.Error
...@@ -1033,7 +1033,7 @@ writeFileAtomic :: FilePath -> BS.ByteString -> IO () ...@@ -1033,7 +1033,7 @@ writeFileAtomic :: FilePath -> BS.ByteString -> IO ()
writeFileAtomic targetPath content = do writeFileAtomic targetPath content = do
let (targetDir, targetFile) = splitFileName targetPath let (targetDir, targetFile) = splitFileName targetPath
Exception.bracketOnError Exception.bracketOnError
(openBinaryTempFile targetDir $ targetFile <.> "tmp") (openBinaryTempFileWithDefaultPermissions targetDir $ targetFile <.> "tmp")
(\(tmpPath, handle) -> hClose handle >> removeFile tmpPath) (\(tmpPath, handle) -> hClose handle >> removeFile tmpPath)
(\(tmpPath, handle) -> do (\(tmpPath, handle) -> do
BS.hPut handle content BS.hPut handle content
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment