I need to copy a file to a tmp location in order to manipulate it. I need to ensure that I always can copy the file.
- Is the following code correct?
- Does it ensure that never try to copy to a location that already exists?
- Is there any chance of failure? (Should I catch any exceptions)
The code that I am using is the following:
string tmpFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Thanks in advance.