From 0e3b101ef28638dbb78fb40c1c19286f7f3e5858 Mon Sep 17 00:00:00 2001 From: its-josh4 <74079536+its-josh4@users.noreply.github.com> Date: Sun, 10 Sep 2023 17:35:55 -0700 Subject: [PATCH] Fixed: CopyFile not working --- 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 1bf98266675..73c5c25712f 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