Changeset 975


Ignore:
Timestamp:
5/5/2009 10:04:22 AM (6 years ago)
Author:
lowjoel
Message:

Delete the folder the user asked for erasure only if it is empty! Fixes the problem in http://bbs.heidi.ie/viewtopic.php?f=2&t=5556

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Manager/DirectExecutor.cs

    r944 r975  
    840840                if (fldr.DeleteIfEmpty) 
    841841                { 
    842                     FileSystem fsManager = FileSystem.Get(VolumeInfo.FromMountpoint(fldr.Path)); 
    843                     fsManager.DeleteFolder(new DirectoryInfo(fldr.Path)); 
     842                    DirectoryInfo info = new DirectoryInfo(fldr.Path); 
     843                    if (info.GetFiles("*", SearchOption.AllDirectories).Length == 0) 
     844                    { 
     845                        FileSystem fsManager = FileSystem.Get(VolumeInfo.FromMountpoint(fldr.Path)); 
     846                        fsManager.DeleteFolder(info); 
     847                    } 
    844848                } 
    845849            } 
Note: See TracChangeset for help on using the changeset viewer.