Changeset 1782
- Timestamp:
- 2/9/2010 8:18:29 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/6.0/Eraser.Manager/DirectExecutor.cs
r1754 r1782 870 870 fsManager.DeleteFolder(info); 871 871 }; 872 eraseEmptySubFolders(new DirectoryInfo(fldr.Path)); 872 873 DirectoryInfo directory = new DirectoryInfo(fldr.Path); 874 foreach (DirectoryInfo subDir in directory.GetDirectories()) 875 eraseEmptySubFolders(subDir); 873 876 874 877 if (fldr.DeleteIfEmpty) 875 878 { 876 DirectoryInfo info = new DirectoryInfo(fldr.Path); 877 progress.Event.CurrentItemName = info.FullName; 879 progress.Event.CurrentItemName = directory.FullName; 878 880 task.OnProgressChanged(progress.Event); 879 881 880 882 //See if this is the root of a volume. 881 bool isVolumeRoot = info.Parent == null;883 bool isVolumeRoot = directory.Parent == null; 882 884 foreach (VolumeInfo volume in VolumeInfo.Volumes) 883 885 foreach (string mountPoint in volume.MountPoints) 884 if ( info.FullName == mountPoint)886 if (directory.FullName == mountPoint) 885 887 isVolumeRoot = true; 886 888 887 889 //If the folder is a mount point, then don't delete it. If it isn't, 888 890 //search for files under the folder to see if it is empty. 889 if (!isVolumeRoot && info.Exists && info.GetFiles("*", SearchOption.AllDirectories).Length == 0) 890 fsManager.DeleteFolder(info); 891 if (!isVolumeRoot && directory.Exists && 892 directory.GetFiles("*", SearchOption.AllDirectories).Length == 0) 893 { 894 fsManager.DeleteFolder(directory); 895 } 891 896 } 892 897 }
Note: See TracChangeset
for help on using the changeset viewer.
