module System.Unix.Misc
( md5sum
, gzip)
where
import Control.Exception
import qualified Codec.Compression.GZip
import Data.ByteString.Lazy.Char8 (empty, readFile, writeFile)
import Data.Digest.Pure.MD5 (md5)
import Data.Maybe
import System.Process
import System.Directory
import System.Exit
import System.IO
import System.Posix.Files
import System.Process
{-# DEPRECATED md5sum "Use Data.ByteString.Lazy.Char8.readFile path >>= return . show . Data.Digest.Pure.MD5.md5" #-}
md5sum :: FilePath -> IO String
md5sum :: FilePath -> IO FilePath
md5sum FilePath
path = FilePath -> IO ByteString
Data.ByteString.Lazy.Char8.readFile FilePath
path forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall (m :: * -> *) a. Monad m => a -> m a
return forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> FilePath
show forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> MD5Digest
md5
{-# DEPRECATED gzip "Use Data.ByteString.Lazy.Char8.readFile path >>= Data.ByteString.Lazy.Char8.writeFile (path ++ \".gz\")" #-}
gzip :: FilePath -> IO ()
gzip :: FilePath -> IO ()
gzip FilePath
path = FilePath -> IO ByteString
Data.ByteString.Lazy.Char8.readFile FilePath
path forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FilePath -> ByteString -> IO ()
Data.ByteString.Lazy.Char8.writeFile (FilePath
path forall a. [a] -> [a] -> [a]
++ FilePath
".gz")