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 link handling on Windows #714

Merged
merged 3 commits into from
Apr 18, 2019

Conversation

tolbrino
Copy link
Contributor

This PR is an extension of #472 including base fallback of recursive copying on all platforms.

emtenet and others added 3 commits April 16, 2019 15:54
The bulk of the code is hidden behind opposite checks:
* os:type() /= {win32, _} in symlink_or_copy/2
* os:type() == {win32, _} in cp_r/2

symlink_or_copy/2 is always using win32_symlink/2 when file:make_symlink/2 fails.
When symlink_or_copy/2 cannot use file:make_symlink/2 on Windows due to the
user lacking SeCreateSymbolicLinkPrivilege it tries a fall back.

Detect the source type and use an appropriate fall back:
* junction for directories and,
* copy for files.

Improve error detection in win32_make_junction/2 and make it repeatable when
the target exists
@tsloughter tsloughter merged commit ead9e97 into erlware:master Apr 18, 2019
@tolbrino tolbrino deleted the tb-fix-windows-links branch April 23, 2019 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants