mirror of
https://github.com/restic/restic.git
synced 2025-03-15 07:40:51 +00:00
dump flag --target should be allowed to write existing file
Signed-off-by: lou <alex1988@outlook.com>
This commit is contained in:
parent
6a2b10e2a8
commit
80db02fc35
@ -174,7 +174,7 @@ func runDump(ctx context.Context, opts DumpOptions, gopts GlobalOptions, args []
|
|||||||
canWriteArchiveFunc := checkStdoutArchive
|
canWriteArchiveFunc := checkStdoutArchive
|
||||||
|
|
||||||
if opts.Target != "" {
|
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 {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot dump to file: %w", err)
|
return fmt.Errorf("cannot dump to file: %w", err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user