build fix

This commit is contained in:
Joey Hess 2015-01-20 17:27:42 -04:00
parent 27c24b7407
commit 7a14edce5a

View file

@ -8,8 +8,10 @@
module Utility.FileSize where
import System.PosixCompat.Files
#ifdef mingw32_HOST_OS
import Control.Exception (bracket)
import System.IO
#endif
{- Gets the size of a file.
-
@ -19,7 +21,7 @@ import System.IO
-}
getFileSize :: FilePath -> IO Integer
#ifndef mingw32_HOST_OS
getFileSize f = fromIntegral . fileSize <$> getFileStatus f
getFileSize f = fmap (fromIntegral . fileSize) (getFileStatus f)
#else
getFileSize f = bracket (openFile f ReadMode) hClose hFileSize
#endif