I am using CSV writer node to write file to my machine. I have selected the overwrite option if there is an existing file.
the same file sometimes is opened by another process where I get the The process cannot access the file because it is being used by another process. error.
CSV Writer does not have this possibility. You can either put writer node within Try/Catch loop within generic loop (see here) and wait while you or someone else closes file either use scripting nodes (for example Java Snippet node) to force closing. Latter option might not be good as someone might lose his work if you force closing.
But who or rather which process also opens file you are writing to? And where is the location of this file?
I see. But before you go implementing can you tell me which other process is accessing your file(s)? Is it another person or workflow or? And how long goes by between writing and overwriting file?