Commit fa920151 authored by Sandeep S. Shewalkar's avatar Sandeep S. Shewalkar
Browse files

New method added to move file to another host

parent 7c5f25d0
Branches
1 merge request!46New method added to move file to another host
Showing with 18 additions and 0 deletions
......@@ -369,6 +369,24 @@ func MoveFile(source, destination string) error {
return os.Rename(source, destination)
}
// MoveFileToOtherHost MoveFileToOtherHost
func MoveFileToOtherHost(source, destination string) error {
// Copy source file to destination
copyError := CopyFile(source, destination)
if copyError != nil {
logginghelper.LogError("error occured while copying file : ",copyError)
return copyError
}
// Delete source file
deleteError := DeleteFile(source)
if deleteError != nil {
logginghelper.LogError("error occured while deleting file : ",deleteError)
return deleteError
}
return nil
}
//CopyFile CopyFile
func CopyFile(source, destination string) error {
// return os.Rename(source, destination)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment