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 incorrect comment about removeDirectoryRecursive and symlinks #1

Merged
merged 1 commit into from Jan 16, 2015
Merged

Fix incorrect comment about removeDirectoryRecursive and symlinks #1

merged 1 commit into from Jan 16, 2015

Conversation

gracjan
Copy link
Contributor

@gracjan gracjan commented Jun 6, 2014

removeDirectoryRecursive removes symlinks inside the directory before it has a chance to follow them.

Exception is the initial path, there symlink is followed. Arguably it should not be the case.

@hvr
Copy link
Member

hvr commented Oct 25, 2014

Is this behavior the same on Windows as well as Unix?

@gracjan
Copy link
Contributor Author

gracjan commented Oct 26, 2014

TL;DR: Yes.

Behavior depends on semantics of 'removeFile' that on Windows is 'Win32.deleteFile' and that is a simple wrapper around DeleteFile system call.

MSDN says:

Symbolic link behavior - If the path points to a symbolic link, the symbolic link is deleted, not the target. To delete a target, you must call CreateFile and specify FILE_FLAG_DELETE_ON_CLOSE.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa363915%28v=vs.85%29.aspx

@hvr hvr modified the milestone: 1.2.1.2 Dec 19, 2014
hvr added a commit that referenced this pull request Jan 16, 2015
Fix incorrect comment about removeDirectoryRecursive and symlinks
@hvr hvr merged commit c43340d into haskell:master Jan 16, 2015
@hvr hvr modified the milestones: 1.2.2, 1.2.2.1 Jan 16, 2015
bgamari pushed a commit to bgamari/directory that referenced this pull request Jul 29, 2016
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.

None yet

2 participants