Ignore:
Timestamp:
3/21/2012 1:46:30 AM (3 years ago)
Author:
lowjoel
Message:

Part 2 fix for https://eraser.heidi.ie/forum/viewtopic.php?f=2&t=8684&p=25969#p25966 since erasing the actual reparse point would cause Eraser to crash if the reparse point references an invalid target.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/FolderErasureTarget.cs

    r2516 r2561  
    197197                //If the folder is a mount point, then don't delete it. If it isn't, 
    198198                //search for files under the folder to see if it is empty. 
    199                 if (!isVolumeRoot && directory.Exists && 
    200                     directory.GetFiles("*", SearchOption.AllDirectories).Length == 0) 
     199                if (!isVolumeRoot && directory.Exists) 
    201200                { 
    202201                    IFileSystem fsManager = Host.Instance.FileSystems[ 
    203202                        VolumeInfo.FromMountPoint(Path)]; 
    204                     fsManager.DeleteFolder(directory, true); 
     203                    if ((directory.Attributes & FileAttributes.ReparsePoint) == 0) 
     204                    { 
     205                        if (directory.GetFiles("*", SearchOption.AllDirectories).Length == 0) 
     206                            fsManager.DeleteFolder(directory, true); 
     207                    } 
     208                    else 
     209                    { 
     210                        fsManager.DeleteFolder(directory, false); 
     211                    } 
    205212                } 
    206213            } 
Note: See TracChangeset for help on using the changeset viewer.