Many a times we get an error, while trying to write file on Windows platform,
"The process cannot access the file 'XXX' because it is being used by another process."
How to check in C#, before writing to file that its not being used by another process?