-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
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
FileShare change to ReadWrite #109104
FileShare change to ReadWrite #109104
Conversation
Tagging subscribers to this area: @dotnet/area-system-io-compression |
This is a behavioral change that doesn't look correct. Zip expects consistency within a file. The same file shouldn't be written simultaneously. |
@huoyaoyuan Some files, such as log files, are opened by writing throughout the entire lifecycle of the program.The folder containing these files can never be packaged. |
You can just create |
@pentp I did solve it as you said, but most of the time people don't want to encounter exceptions when using ZipArchive and spend a lot of time looking for temporary solutions |
This is not true. Most of the time people are expecting the methods to be reliable. Reading files that are written by other process requires extra causion and collaboration with the writer. This is not reliable by default. |
Using compression software such as WinRar, built-in compression in Windows 11, etc., can all be used normally. |
Agree with what is said by @huoyaoyuan. Opening a file with write sharing could cause us to write a torn file when we previously would have failed to write at all. Consider in the middle of the call You should be able to use other API to perform this action if you can somehow guarantee that other writers to the file will never actually write it, but we should not take this change. If you'd like to further discuss you can do so in an issue. |
No description provided.