You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Directory.Delete(string,bool) follows the reparse point, which is wrong.
System.IO.Directory.Delete:
"The behavior of this method differs slightly when deleting a directory that contains a reparse point, such as a symbolic link or a mount point. If the reparse point is a directory, such as a mount point, it is unmounted and the mount point is deleted. This method does not recurse through the reparse point. If the reparse point is a symbolic link to a file, the reparse point is deleted and not the target of the symbolic link. " https://msdn.microsoft.com/en-us/library/fxeahc5f%28v=vs.110%29.aspx
Fast fix would be:
public static void Delete(string path, bool recursive) {
var isReparsePoint=(new DirectoryInfo(path).Attributes & System.IO.FileAttributes.ReparsePoint) != 0;
if (isReparsePoint) { Delete(path); return;}
...
}
And by the way parameter "recursive" is never used!
The text was updated successfully, but these errors were encountered:
Directory.Delete(string,bool) follows the reparse point, which is wrong.
System.IO.Directory.Delete:
"The behavior of this method differs slightly when deleting a directory that contains a reparse point, such as a symbolic link or a mount point. If the reparse point is a directory, such as a mount point, it is unmounted and the mount point is deleted. This method does not recurse through the reparse point. If the reparse point is a symbolic link to a file, the reparse point is deleted and not the target of the symbolic link. " https://msdn.microsoft.com/en-us/library/fxeahc5f%28v=vs.110%29.aspx
Fast fix would be:
public static void Delete(string path, bool recursive) {
var isReparsePoint=(new DirectoryInfo(path).Attributes & System.IO.FileAttributes.ReparsePoint) != 0;
if (isReparsePoint) { Delete(path); return;}
...
}
And by the way parameter "recursive" is never used!
The text was updated successfully, but these errors were encountered: