diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-12-24 14:53:58 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-12-24 14:53:58 -0400 |
commit | 122b09e2f24cff55c65b84cbccd78ed640a234be (patch) | |
tree | 5f9f1929b2fccb9d9a783a0a53f56ba13aae7897 /Utility/Misc.hs | |
parent | 1b18f539f2bace903c853ce828902a8061007da5 (diff) | |
download | git-repair-122b09e2f24cff55c65b84cbccd78ed640a234be.tar.gz |
Merge from git-annex.
Diffstat (limited to 'Utility/Misc.hs')
-rw-r--r-- | Utility/Misc.hs | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/Utility/Misc.hs b/Utility/Misc.hs index ebb4257..4498c0a 100644 --- a/Utility/Misc.hs +++ b/Utility/Misc.hs @@ -10,9 +10,6 @@ module Utility.Misc where -import Utility.FileSystemEncoding -import Utility.Monad - import System.IO import Control.Monad import Foreign @@ -35,20 +32,6 @@ hGetContentsStrict = hGetContents >=> \s -> length s `seq` return s readFileStrict :: FilePath -> IO String readFileStrict = readFile >=> \s -> length s `seq` return s -{- Reads a file strictly, and using the FileSystemEncoding, so it will - - never crash on a badly encoded file. -} -readFileStrictAnyEncoding :: FilePath -> IO String -readFileStrictAnyEncoding f = withFile f ReadMode $ \h -> do - fileEncoding h - hClose h `after` hGetContentsStrict h - -{- Writes a file, using the FileSystemEncoding so it will never crash - - on a badly encoded content string. -} -writeFileAnyEncoding :: FilePath -> String -> IO () -writeFileAnyEncoding f content = withFile f WriteMode $ \h -> do - fileEncoding h - hPutStr h content - {- Like break, but the item matching the condition is not included - in the second result list. - |