From b36aa745d8d426c51568d5adc02b56a56b5342a9 Mon Sep 17 00:00:00 2001 From: its-josh4 <74079536+its-josh4@users.noreply.github.com> Date: Sun, 10 Sep 2023 21:43:42 -0700 Subject: [PATCH] Fixed: CopyFile not working (#4104) --- pkg/fsutil/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/fsutil/file.go b/pkg/fsutil/file.go index 918c45d89bb..0c0eb52715f 100644 --- a/pkg/fsutil/file.go +++ b/pkg/fsutil/file.go @@ -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