New method added to move file to another host

Merged Sandeep S. Shewalkar requested to merge MoveFile_SSS into master
Compare and
1 file
+ 18
0
Preferences
File browser
Compare changes
+ 18
0
@@ -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)