summaryrefslogtreecommitdiff
path: root/src/compiler/GF/System/Directory.hs
blob: 3cd8a8ef6b7500497098fe1e89acae8ee0014c06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- | Isolate backwards incompatible library changes to 'getModificationTime'
-- and provide lifted versions of some directory operations
module GF.System.Directory(module GF.System.Directory,module D) where
import Control.Monad.Trans(MonadIO(..))
import qualified System.Directory as D
import System.Directory as D
       hiding (doesDirectoryExist,doesFileExist,getModificationTime,
               getCurrentDirectory,getDirectoryContents,removeFile)
import Data.Time.Compat

doesDirectoryExist path = liftIO $ D.doesDirectoryExist path
doesFileExist path = liftIO $ D.doesFileExist path
getModificationTime path = liftIO $ fmap toUTCTime (D.getModificationTime path)
getDirectoryContents path = liftIO $ D.getDirectoryContents path

getCurrentDirectory :: MonadIO io => io FilePath
getCurrentDirectory = liftIO D.getCurrentDirectory

removeFile path = liftIO $ D.removeFile path