Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
coreospackage
Merge requests
!46
New method added to move file to another host
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
New method added to move file to another host
MoveFile_SSS
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Sandeep S. Shewalkar
requested to merge
MoveFile_SSS
into
master
6 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
fa920151
1 commit,
6 years ago
1 file
+
18
−
0
Expand all files
Preferences
File browser
List view
Tree view
Compare changes
Inline
Side-by-side
Show whitespace changes
Show one file at a time
filehelper/fileHelper.go
+
18
−
0
Options
@@ -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)
Menu
Explore
Projects
Groups
Topics
Snippets