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
b84b6a2d
Commit
b84b6a2d
authored
7 years ago
by
Sandeep S. Shewalkar
Browse files
Options
Downloads
Plain Diff
Merge branch 'DevBranch' into 'stagingbranch'
Update fileutil.go See merge request
!16
parents
afd76128
4cda9273
2 merge requests
!17
Stagingbranch
,
!16
Update fileutil.go
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
downloadhelper/fileutil.go
+8
-5
downloadhelper/fileutil.go
with
8 additions
and
5 deletions
downloadhelper/fileutil.go
+
8
−
5
View file @
b84b6a2d
...
...
@@ -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
)
{
...
...
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