Changeset 894 for branches/eraser6/Manager/DirectExecutor.cs
- Timestamp:
- 4/27/2009 12:46:42 PM (4 years ago)
- File:
-
- 1 edited
-
branches/eraser6/Manager/DirectExecutor.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Manager/DirectExecutor.cs
r893 r894 1026 1026 task.OnProgressChanged(progress.Event); 1027 1027 1028 //Make sure the file does not have any attributes which may affect 1029 //the erasure process 1028 1029 //Remove the read-only flag, if it is set. 1030 StreamInfo info = new StreamInfo(paths[i]); 1030 1031 bool isReadOnly = false; 1031 StreamInfo info = new StreamInfo(paths[i]);1032 if ((info.Attributes & FileAttributes.Compressed) != 0 ||1033 (info.Attributes & FileAttributes.Encrypted) != 0 ||1034 (info.Attributes & FileAttributes.SparseFile) != 0)1035 {1036 //Log the error1037 //TODO: This would leave files after the list unerased. Log this as an error instead1038 throw new ArgumentException(S._("Compressed, encrypted, or sparse" +1039 "files cannot be erased with Eraser."));1040 }1041 1042 //Remove the read-only flag, if it is set.1043 1032 if (isReadOnly = info.IsReadOnly) 1044 1033 info.IsReadOnly = false; … … 1046 1035 try 1047 1036 { 1037 //Make sure the file does not have any attributes which may affect 1038 //the erasure process 1039 if ((info.Attributes & FileAttributes.Compressed) != 0 || 1040 (info.Attributes & FileAttributes.Encrypted) != 0 || 1041 (info.Attributes & FileAttributes.SparseFile) != 0) 1042 { 1043 //Log the error 1044 task.Log.Add(new LogEntry(S._("The file {0} could not be erased " + 1045 "because the file was either compressed, encrypted or a sparse file.", 1046 info.FullName), LogLevel.ERROR)); 1047 } 1048 1048 1049 //Create the file stream, and call the erasure method to write to 1049 1050 //the stream. … … 1099 1100 LogLevel.ERROR)); 1100 1101 } 1102 catch (FileLoadException) 1103 { 1104 task.Log.Add(new LogEntry(S._("The file {0} could not be erased because the " + 1105 "file is currently in use.", info.FullName), LogLevel.ERROR)); 1106 } 1101 1107 finally 1102 1108 {
Note: See TracChangeset
for help on using the changeset viewer.
