stub out posix stuff for Windows

This is enough to let the configure program build.
This commit is contained in:
Joey Hess 2013-05-10 15:08:53 -05:00
parent 767a39bd42
commit a05b4619bb
8 changed files with 62 additions and 3 deletions

8
Utility/Directory.hs Normal file → Executable file
View file

@ -5,10 +5,14 @@
- Licensed under the GNU GPL version 3 or higher.
-}
{-# LANGUAGE CPP #-}
module Utility.Directory where
import System.IO.Error
#if 0
import System.Posix.Files
#endif
import System.Directory
import Control.Exception (throw)
import Control.Monad
@ -57,6 +61,7 @@ dirContentsRecursive' (dir:dirs) = unsafeInterleaveIO $ do
{- Moves one filename to another.
- First tries a rename, but falls back to moving across devices if needed. -}
moveFile :: FilePath -> FilePath -> IO ()
#if 0
moveFile src dest = tryIO (rename src dest) >>= onrename
where
onrename (Right _) = noop
@ -84,6 +89,9 @@ moveFile src dest = tryIO (rename src dest) >>= onrename
case r of
(Left _) -> return False
(Right s) -> return $ isDirectory s
#else
moveFile = error "moveFile TODO"
#endif
{- Removes a file, which may or may not exist.
-