I'm currently copying the archive files of our oracle server
, the one that i'm preventing to happen is while i'm copying the file server will have an error when it tried to update the file.
At first i tried
File.Copy(source, Destination, true);
But it seems like this method is locking the file, the server throw an error in the log:
OSD-04002: unable to open file
O/S-Error: (OS 32) The process cannot access the file because it is being used by another process.
I change my method to
FileStream rStream = new FileStream(source, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
But when i try to open the file using a test program with FileShare. Now it throws an error also that another process is locking the file.
Is it possible to let go or release the file once another process wants to access/write to it?