Changeset 2632


Ignore:
Timestamp:
05/22/12 05:21:16 (3 years ago)
Author:
lowjoel
Message:

When erasing a file/folder, it is possible that after the erase is complete the file or containing directory was deleted by the user or another program before it can be erased. A FileNotFoundException? or DirectoryNotFoundException? would be raised respectively, so handle that situation by logging a warning.

File:
1 edited

Legend:

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

    r2606 r2632  
    342342                    else 
    343343                        Logger.Log(S._("The file {0} is a hard link or a symbolic link thus the " + 
    344                             "contents of the file was not erased.", LogLevel.Notice)); 
     344                            "contents of the file was not erased.", info.FullName), LogLevel.Notice); 
    345345                    return; 
     346                } 
     347                catch (FileNotFoundException) 
     348                { 
     349                    Logger.Log(S._("The file {0} was not securely erased because the file was " + 
     350                        "deleted before it could be erased.", info.FullName), LogLevel.Warning); 
     351                } 
     352                catch (DirectoryNotFoundException) 
     353                { 
     354                    Logger.Log(S._("The file {0} was not securely erased because the containing " + 
     355                        "directory was deleted before it could be erased.", info.FullName), 
     356                        LogLevel.Warning); 
    346357                } 
    347358                catch (SharingViolationException) 
Note: See TracChangeset for help on using the changeset viewer.