LIB: improve performance of copyDir
This commit is contained in:
parent
074ee45961
commit
e67d68ab15
@ -79,6 +79,7 @@ runFileOp _ = return ()
|
|||||||
|
|
||||||
|
|
||||||
-- TODO: copy modes
|
-- TODO: copy modes
|
||||||
|
-- TODO: allow renaming
|
||||||
copyDir :: DTInfoZipper -- ^ source dir
|
copyDir :: DTInfoZipper -- ^ source dir
|
||||||
-> DTInfoZipper -- ^ destination dir
|
-> DTInfoZipper -- ^ destination dir
|
||||||
-> IO ()
|
-> IO ()
|
||||||
@ -92,9 +93,10 @@ copyDir from@(Dir fn _ _, _) to@(Dir {}, _) = do
|
|||||||
throwDestinationInSource fromp top
|
throwDestinationInSource fromp top
|
||||||
|
|
||||||
createDirectoryIfMissing False destdir
|
createDirectoryIfMissing False destdir
|
||||||
|
|
||||||
for_ (goAllDown from) $ \f -> do
|
|
||||||
newDest <- zipLazy mkDirInfo mkFileInfo destdir
|
newDest <- zipLazy mkDirInfo mkFileInfo destdir
|
||||||
|
|
||||||
|
for_ (goAllDown from) $ \f ->
|
||||||
|
-- TODO: maybe do this strict?
|
||||||
case f of
|
case f of
|
||||||
-- recreate symlink
|
-- recreate symlink
|
||||||
sz@(Dir { name = n, dir = (DirInfo { sym = True }) }, _) -> do
|
sz@(Dir { name = n, dir = (DirInfo { sym = True }) }, _) -> do
|
||||||
@ -112,7 +114,6 @@ copyDir from@(File _ _, _) _ = throw $ NotADir (getFullPath from)
|
|||||||
copyDir _ to@(File _ _, _) = throw $ NotADir (getFullPath to)
|
copyDir _ to@(File _ _, _) = throw $ NotADir (getFullPath to)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- |Copies the given file.
|
-- |Copies the given file.
|
||||||
--
|
--
|
||||||
-- This will throw an exception if any of the filepaths are not absolute
|
-- This will throw an exception if any of the filepaths are not absolute
|
||||||
|
Loading…
Reference in New Issue
Block a user