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
!16
Update fileutil.go
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Update fileutil.go
DevBranch
into
stagingbranch
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Sandeep S. Shewalkar
requested to merge
DevBranch
into
stagingbranch
7 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Changes made by rahuls in fileutils
0
0
Merge request reports
Compare
stagingbranch
stagingbranch (base)
and
latest version
latest version
4cda9273
1 commit,
7 years ago
1 file
+
8
−
5
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
downloadhelper/fileutil.go
+
8
−
5
Options
@@ -61,13 +61,15 @@ func mergeFiles(filename string, count int) {
fmt
.
Println
(
"temp file name : "
+
tempFilename
)
fmt
.
Println
(
"file name : "
+
filename
)
file
,
err
:=
os
.
OpenFile
(
DownloadLocation
+
"/"
+
tempFilename
,
os
.
O_CREATE
|
os
.
O_WRONLY
|
os
.
O_APPEND
,
0666
)
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
defer
file
.
Close
()
for
i
:=
0
;
i
<
count
;
i
++
{
partFilename
:=
DownloadLocation
+
"/temp/"
+
filename
+
"_"
+
strconv
.
Itoa
(
i
)
file
,
err
:=
os
.
OpenFile
(
DownloadLocation
+
"/"
+
tempFilename
,
os
.
O_CREATE
|
os
.
O_WRONLY
|
os
.
O_APPEND
,
0666
)
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
defer
file
.
Close
()
reader
,
err
:=
ioutil
.
ReadFile
(
partFilename
)
reader
=
reader
[
16
:
]
if
err
!=
nil
{
@@ -77,6 +79,7 @@ func mergeFiles(filename string, count int) {
log
.
Fatal
(
err
)
}
}
file
.
Close
()
os
.
Rename
(
DownloadLocation
+
"/"
+
tempFilename
,
DownloadLocation
+
"/"
+
filename
)
}
func
isDirEmpty
(
name
string
)
(
bool
,
error
)
{
Menu
Explore
Projects
Groups
Topics
Snippets