forked from TrueCloudLab/frostfs-node
[#1726] neofs-cli: Truncate file before writing the object
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
40f1cf36e1
commit
d57c57010f
1 changed files with 1 additions and 1 deletions
|
@ -53,7 +53,7 @@ func getObject(cmd *cobra.Command, _ []string) {
|
|||
if filename == "" {
|
||||
out = os.Stdout
|
||||
} else {
|
||||
f, err := os.OpenFile(filename, os.O_CREATE|os.O_WRONLY, 0644)
|
||||
f, err := os.OpenFile(filename, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)
|
||||
if err != nil {
|
||||
common.ExitOnErr(cmd, "", fmt.Errorf("can't open file '%s': %w", filename, err))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue