Changeset 2337


Ignore:
Timestamp:
10/30/2011 1:18:24 AM (7 months ago)
Author:
lowjoel
Message:

Supplants r2335: if we still cannot erase the file after 1 retry, throw a new SharingViolationException? with the program name locking the file. This will prevent the file from being deleted simplistically.

File:
1 edited

Legend:

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

    r2336 r2337  
    281281                    "permissions prevent access to the file.", info.FullName), LogLevel.Error); 
    282282            } 
     283            catch (SharingViolationException e) 
     284            { 
     285                Logger.Log(e.Message, LogLevel.Error); 
     286            } 
    283287            finally 
    284288            { 
     
    357361                    } 
    358362 
    359                     Logger.Log(S._("Could not force closure of file \"{0}\" {1}", 
    360                             info.FileName, S._("(locked by {0})", 
    361                                 processStr.ToString().Remove(processStr.Length - 2)).Trim()), 
    362                         LogLevel.Error); 
    363                     throw; 
     363                    throw new SharingViolationException(S._( 
     364                        "Could not force closure of file \"{0}\" {1}", info.FileName, 
     365                        S._("(locked by {0})", 
     366                            processStr.ToString().Remove(processStr.Length - 2)).Trim()), 
     367                        info.FileName); 
    364368                } 
    365369            } 
Note: See TracChangeset for help on using the changeset viewer.