Ignore:
Timestamp:
7/10/2010 8:36:36 AM (23 months ago)
Author:
lowjoel
Message:

Define proper behaviour when a directory reparse point (symbolic link/junction) is encountered. We should not touch the target of the reparse point, instead, just securely remove the reparse point. This also fixes a crash when a reparse point to the current directory is encountered (i.e. a folder referring to its immediate parent)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.DefaultPlugins/FileSystems/Windows.cs

    r2212 r2222  
    6363                    "not empty.")); 
    6464 
    65             //TODO: check for reparse points 
    66             foreach (DirectoryInfo dir in info.GetDirectories()) 
    67                 DeleteFolder(dir); 
    68             foreach (FileInfo file in info.GetFiles()) 
    69                 DeleteFile(file); 
     65            if ((info.Attributes & FileAttributes.ReparsePoint) != 0) 
     66            { 
     67                foreach (DirectoryInfo dir in info.GetDirectories()) 
     68                    DeleteFolder(dir); 
     69                foreach (FileInfo file in info.GetFiles()) 
     70                    DeleteFile(file); 
     71            } 
    7072 
    7173            DeleteFileSystemInfo(info); 
Note: See TracChangeset for help on using the changeset viewer.