Skip to content

Fix incorrect comment about removeDirectoryRecursive and symlinks - #1

Merged
hvr merged 1 commit into
haskell:masterfrom
gracjan:master
Jan 16, 2015
Merged

Fix incorrect comment about removeDirectoryRecursive and symlinks#1
hvr merged 1 commit into
haskell:masterfrom
gracjan:master

Conversation

@gracjan

@gracjan gracjan commented Jun 6, 2014

Copy link
Copy Markdown
Contributor

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

hvr commented Oct 25, 2014

Copy link
Copy Markdown
Member

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

@gracjan

gracjan commented Oct 26, 2014

Copy link
Copy Markdown
Contributor Author

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.

2 participants