Replies: 3 comments 3 replies
-
The os.Create truncates if the file exists. We can bypass this by checking if file exists, and if it does we can remove that file to create new file and output is stored in that file. What do you think @knqyf263 ? @roi-orca When i tried implemeted the file close in that file, it seems the file is already closed as i am getting errors in the integration tests. |
Beta Was this translation helpful? Give feedback.
3 replies
-
Created an issue for tracking |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
When running trivy with --output flag and then our application try to delete the report file on windows, the deletion fail on
The process cannot access the file because it is being used by another process
since the file is not closed in trivy.Reference:
https://github.com/aquasecurity/trivy/blob/main/pkg/flag/report_flags.go#L217-L222
What did you expect to happen?
Close the file after writing the report
What happened instead?
The file is not closed
Beta Was this translation helpful? Give feedback.
All reactions