Fixed: CopyFile not working (#4104)

This commit is contained in:
its-josh4 2023-09-10 21:43:42 -07:00 committed by GitHub
parent da38ec03c0
commit b36aa745d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ func CopyFile(srcpath, dstpath string) (err error) {
return err
}
w, err := os.OpenFile(dstpath, os.O_CREATE|os.O_EXCL, 0666)
w, err := os.OpenFile(dstpath, os.O_CREATE|os.O_WRONLY|os.O_EXCL, 0666)
if err != nil {
r.Close() // We need to close the input file as the defer below would not be called.
return err