We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As #63912 has shown, there are places in BCL where files are being closed and very soon reopened (it's typically not obvious).
using (FileStream fs = new FileStream(destinationFileName, fMode, FileAccess.Write, FileShare.None, bufferSize: 0x1000, useAsync: false)) { using (Stream es = source.Open()) es.CopyTo(fs); } // the file is closed File.SetLastWriteTime(destinationFileName, source.LastWriteTime.DateTime); // it's reopened
It causes two kinds of problems:
ERROR_SHARING_VIOLATION
One of the potential solutions would be to use APIs that are accepting SafeFileHandle like #20234
SafeFileHandle
The text was updated successfully, but these errors were encountered:
Tagging subscribers to this area: @dotnet/area-system-io See info in area-owners.md if you want to be subscribed.
area-System.IO
Sorry, something went wrong.
No branches or pull requests
As #63912 has shown, there are places in BCL where files are being closed and very soon reopened (it's typically not obvious).
It causes two kinds of problems:
ERROR_SHARING_VIOLATION
on Windows)One of the potential solutions would be to use APIs that are accepting
SafeFileHandle
like #20234The text was updated successfully, but these errors were encountered: