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
Commits
ffad25f6
Commit
ffad25f6
authored
6 years ago
by
Ajit Jagtap
Browse files
Options
Downloads
Plain Diff
Merge branch 'MoveFile_SSS' into 'master'
New method added to move file to another host See merge request
!46
parents
7c5f25d0
fa920151
Branches
Branches containing commit
1 merge request
!46
New method added to move file to another host
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
filehelper/fileHelper.go
+18
-0
filehelper/fileHelper.go
with
18 additions
and
0 deletions
filehelper/fileHelper.go
+
18
−
0
View file @
ffad25f6
...
...
@@ -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)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets