1 parent
930364ce78
commit
94e06201f9
5 files changed
+13
-23
No files matched your search
@@ -41,7 +41,7 @@ func copyFile(src, dst string, info os.FileInfo, nums chan int64) error {
|
||||
}
|
||||
defer r.Close()
|
||||
|
||||
w, err := os.Create(dst)
|
||||
w, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE|os.O_TRUNC, info.Mode())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -70,11 +70,6 @@ func copyFile(src, dst string, info os.FileInfo, nums chan int64) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := os.Chmod(dst, info.Mode()); err != nil {
|
||||
os.Remove(dst)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user