no need to stub moveFile, it works
This commit is contained in:
parent
c45a723876
commit
93e3c8a09a
1 changed files with 1 additions and 9 deletions
|
@ -5,14 +5,10 @@
|
||||||
- Licensed under the GNU GPL version 3 or higher.
|
- Licensed under the GNU GPL version 3 or higher.
|
||||||
-}
|
-}
|
||||||
|
|
||||||
{-# LANGUAGE CPP #-}
|
|
||||||
|
|
||||||
module Utility.Directory where
|
module Utility.Directory where
|
||||||
|
|
||||||
import System.IO.Error
|
import System.IO.Error
|
||||||
#ifndef mingw32_HOST_OS
|
import System.PosixCompat.Files
|
||||||
import System.Posix.Files
|
|
||||||
#endif
|
|
||||||
import System.Directory
|
import System.Directory
|
||||||
import Control.Exception (throw)
|
import Control.Exception (throw)
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
|
@ -61,7 +57,6 @@ dirContentsRecursive' (dir:dirs) = unsafeInterleaveIO $ do
|
||||||
{- Moves one filename to another.
|
{- Moves one filename to another.
|
||||||
- First tries a rename, but falls back to moving across devices if needed. -}
|
- First tries a rename, but falls back to moving across devices if needed. -}
|
||||||
moveFile :: FilePath -> FilePath -> IO ()
|
moveFile :: FilePath -> FilePath -> IO ()
|
||||||
#ifndef mingw32_HOST_OS
|
|
||||||
moveFile src dest = tryIO (rename src dest) >>= onrename
|
moveFile src dest = tryIO (rename src dest) >>= onrename
|
||||||
where
|
where
|
||||||
onrename (Right _) = noop
|
onrename (Right _) = noop
|
||||||
|
@ -89,9 +84,6 @@ moveFile src dest = tryIO (rename src dest) >>= onrename
|
||||||
case r of
|
case r of
|
||||||
(Left _) -> return False
|
(Left _) -> return False
|
||||||
(Right s) -> return $ isDirectory s
|
(Right s) -> return $ isDirectory s
|
||||||
#else
|
|
||||||
moveFile = error "moveFile TODO"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{- Removes a file, which may or may not exist.
|
{- Removes a file, which may or may not exist.
|
||||||
-
|
-
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue