From 80db02fc3521612c7dc7ce86a9e57f17e20ee9df Mon Sep 17 00:00:00 2001 From: lou Date: Thu, 8 Feb 2024 14:11:57 +0800 Subject: [PATCH] dump flag --target should be allowed to write existing file Signed-off-by: lou --- cmd/restic/cmd_dump.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/restic/cmd_dump.go b/cmd/restic/cmd_dump.go index 1628d6a95..9178f2abe 100644 --- a/cmd/restic/cmd_dump.go +++ b/cmd/restic/cmd_dump.go @@ -174,7 +174,7 @@ func runDump(ctx context.Context, opts DumpOptions, gopts GlobalOptions, args [] canWriteArchiveFunc := checkStdoutArchive if opts.Target != "" { - file, err := os.OpenFile(opts.Target, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0o666) + file, err := os.Create(opts.Target) if err != nil { return fmt.Errorf("cannot dump to file: %w", err) }