Use 'r+' with truncation when saving existing files on Windows#42899
Merged
bpasero merged 3 commits intomicrosoft:masterfrom Aug 20, 2018
seishun:always-r+
Merged
Use 'r+' with truncation when saving existing files on Windows#42899bpasero merged 3 commits intomicrosoft:masterfrom seishun:always-r+
bpasero merged 3 commits intomicrosoft:masterfrom
seishun:always-r+
Conversation
Opening a file with 'w' flag removes its alternate data streams. To prevent this, extend the logic used for hidden files to all existing files. Fixes: #6363
|
I think this would be better as a configuration item (default off) for all platforms. It's becoming quite common for editors to support the ability to disable safe writes (i.e. enable save in place); I'd imagine this would therefore be of benefit to Mac OS and Linux files using ACLs? |
This was referenced May 26, 2018
|
This also fixes #49021 |
|
@bpasero Is there a chance this gets merged? This would be a blessing for all WSL users. |
Member
|
Thanks for the PR, I think we should try to go with it as it seems like the only solution. I fear a little bit the consequences this could have compared to how we save today, but our insiders hopefully reveal if there are any. If there are issues we might have to put this behind a setting. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opening a file with 'w' flag removes its alternate data streams. To
prevent this, extend the logic used for hidden files to all existing
files.
Fixes: #6363