diff options
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/FileMode.hs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Utility/FileMode.hs b/Utility/FileMode.hs index 46c6a31f5..b17cadc3b 100644 --- a/Utility/FileMode.hs +++ b/Utility/FileMode.hs @@ -133,10 +133,8 @@ setSticky f = modifyFileMode f $ addModes [stickyMode] - as writeFile. -} writeFileProtected :: FilePath -> String -> IO () -writeFileProtected file content = do - h <- openFile file WriteMode +writeFileProtected file content = withFile file WriteMode $ \h -> do void $ tryIO $ modifyFileMode file $ removeModes [groupReadMode, otherReadMode] hPutStr h content - hClose h |