Skip to content
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

Fix File.Copy onto a symlink on macOS #87600

Merged
merged 6 commits into from
Jun 16, 2023
Merged

Fix File.Copy onto a symlink on macOS #87600

merged 6 commits into from
Jun 16, 2023

Conversation

hamarb123
Copy link
Contributor

@hamarb123 hamarb123 commented Jun 15, 2023

Resolve s the discussion at #79243 (comment).

I introduced a minor bug in #79243, which meant that using File.Copy onto a symlink won't produce the expected behaviour of modifying what the symlink points to, as opposed to what I implemented, which was to replace the symlink.

This fix should be basically zero additional cost currently, as it doesn't introduce any additional syscalls (except for the case we're fixing). Also adds a test to catch this in the future.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Jun 15, 2023
@ghost
Copy link

ghost commented Jun 15, 2023

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

Resolves #79243 (comment).

I introduced a minor bug in #79243, which means that using File.Copy onto a symlink won't produce the expected behaviour of modifying what the symlink points to, as opposed to what I implemented which was to replace the symlink.

This fix should be basically zero additional cost currently, as it doesn't introduce any additional syscalls (except for the case we're fixing). Also adds a test to catch this in the future.

Author: hamarb123
Assignees: -
Labels:

area-System.IO, community-contribution

Milestone: -

@jozkee jozkee merged commit 10335b8 into dotnet:main Jun 16, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jul 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.IO community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants