LIB: rm obsolete overwriteFile

This commit is contained in:
Julian Ospald 2016-04-03 22:54:17 +02:00
parent 0d92ebb8c8
commit 695f921c2e
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28

View File

@ -273,25 +273,6 @@ copyFile cm from@(_ :/ RegFile {}) to@(_ :/ Dir {}) fn
copyFile _ _ _ _ = throw $ InvalidOperation "wrong input type"
-- |Copies the given file to the given file destination, overwriting it.
-- Excludes symlinks.
overwriteFile :: AnchoredFile FileInfo -- ^ source file
-> AnchoredFile FileInfo -- ^ destination file
-> IO ()
overwriteFile AFileInvFN _ = throw InvalidFileName
overwriteFile _ AFileInvFN = throw InvalidFileName
overwriteFile from@(_ :/ RegFile {})
to@(_ :/ RegFile {})
= do
let from' = fullPath from
to' = fullPath to
throwCantOpenDirectory $ P.dirname from'
throwCantOpenDirectory $ P.dirname to'
throwSameFile from' to'
copyFile Replace from to (name . file $ to)
overwriteFile _ _ = throw $ InvalidOperation "wrong input type"
-- |Copies a file, directory or symlink. In case of a symlink, it is just
-- recreated, even if it points to a directory.
easyCopy :: CopyMode