多线程分片下载
This commit is contained in:
parent
74cccba197
commit
450e4940b2
@ -166,7 +166,7 @@ func (d *Downloader) Run() error {
|
|||||||
fByte := make([]byte, d.FileSize)
|
fByte := make([]byte, d.FileSize)
|
||||||
|
|
||||||
if exists(path) {
|
if exists(path) {
|
||||||
tmpFile, err = os.OpenFile(path, os.O_RDWR, 0)
|
tmpFile, err = os.OpenFile(path, os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user