Skip to content

Conversation

@MisterDA
Copy link
Contributor

@MisterDA MisterDA commented Sep 16, 2021

If a Windows symlink points to a directory, then rmdir is the correct
function to call. If it points to a file, then unlink is the correct
function. When pointing to a file, the symlink can also have the
read-only attribute, which makes it subject of the little chmod dance.

This depends on the fix in #883.

@smorimoto
Copy link
Member

@MisterDA Could you rebase this?

@MisterDA MisterDA force-pushed the with-temp-dir-symlinks branch from cd95cc4 to ce82439 Compare October 6, 2021 13:07
@MisterDA
Copy link
Contributor Author

MisterDA commented Oct 6, 2021

Rebased.

@smorimoto
Copy link
Member

Thanks!

@MisterDA
Copy link
Contributor Author

MisterDA commented Oct 7, 2021

This is related to ocaml/ocaml#10642. At the moment neither Sys.remove nor Unix.unlink can remove symlinks to directories on Windows, but POSIX unlink(2) can remove symlinks (regardless of whether they're symlinks to files or directories).
I think I'll probably provide write in the future the variant that the comment suggest, switching to blocking files and a detached thread.

@MisterDA MisterDA mentioned this pull request Oct 21, 2021
1 task
If a Windows symlink points to a directory, then rmdir is the correct
function to call. If it points to a file, then unlink is the correct
function. When pointing to a file, the symlink can also have the
read-only attribute, which makes it subject of the little chmod dance.
@smorimoto smorimoto force-pushed the with-temp-dir-symlinks branch from ce82439 to e902075 Compare November 7, 2021 06:04
@smorimoto smorimoto merged commit 99c5635 into ocsigen:master Nov 7, 2021
@MisterDA MisterDA deleted the with-temp-dir-symlinks branch November 7, 2021 11:05
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.

2 participants