Changeset 2166


Ignore:
Timestamp:
06/13/10 04:08:49 (4 years ago)
Author:
lowjoel
Message:

Handle UnauthorizedAccessExceptions? when erasing folders, as certain folders allow us to erase the files within but not the folder itself.

File:
1 edited

Legend:

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

    r1968 r2166  
    868868                    FileSystemInfo[] files = info.GetFileSystemInfos(); 
    869869                    if (files.Length == 0) 
    870                         fsManager.DeleteFolder(info); 
     870                        try 
     871                        { 
     872                            fsManager.DeleteFolder(info); 
     873                        } 
     874                        catch (UnauthorizedAccessException) 
     875                        { 
     876                            task.Log.LastSessionEntries.Add(new LogEntry(S._( 
     877                                "The folder {0} could not be deleted because the folder's " + 
     878                                "permissions prevents the deletion of the folder.", info.FullName), 
     879                                LogLevel.Error)); 
     880                        } 
    871881                }; 
    872882 
Note: See TracChangeset for help on using the changeset viewer.