Skip to content

Use 'r+' with truncation when saving existing files on Windows#42899

Merged
bpasero merged 3 commits intomicrosoft:masterfrom
seishun:always-r+
Aug 20, 2018
Merged

Use 'r+' with truncation when saving existing files on Windows#42899
bpasero merged 3 commits intomicrosoft:masterfrom
seishun:always-r+

Conversation

@seishun
Copy link
Contributor

@seishun seishun commented Feb 3, 2018

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

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
@WSLUser
Copy link

WSLUser commented May 8, 2018

@bpasero Can this be reviewed so we can resolve #49021?

@andrewmackrodt
Copy link

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?

@drujd
Copy link

drujd commented Jun 27, 2018

This also fixes #49021

@drujd
Copy link

drujd commented Aug 19, 2018

@bpasero Is there a chance this gets merged? This would be a blessing for all WSL users.

@bpasero bpasero modified the milestones: Backlog, August 2018 Aug 20, 2018
@bpasero
Copy link
Member

bpasero commented Aug 20, 2018

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.

@bpasero bpasero merged commit aaa778b into microsoft:master Aug 20, 2018
@seishun seishun deleted the always-r+ branch August 20, 2018 16:57
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alternate data streams are removed by saving

5 participants