cyclonedx-cli icon indicating copy to clipboard operation
cyclonedx-cli copied to clipboard

Pre-Existing output file is not truncated when overwritten

Open flemminglau opened this issue 3 years ago • 2 comments

In a merge operation in case the output file already exists and is thereby overwritten the previous content is not first truncated.

The result is that in case the new file content is shorter than the old file content the remaining part of the old file is left behind at the end of the new file.

The expectation would be that an existing output file is completely removed when overwritten.

flemminglau avatar Aug 11 '22 09:08 flemminglau

Aha, that is why I am seeing this problem with corrupted json files. thanks. easily fixed in my use-case.

Andrew-Russell-fingo avatar Mar 29 '23 21:03 Andrew-Russell-fingo

Nice to see there already is a fix in the pipeline. We have run into the same issue :)

Serraniel avatar Apr 20 '23 08:04 Serraniel