Changeset 1441
- Timestamp:
- 01/04/10 09:44:58 (3 years ago)
- Location:
- branches/eraser6/6.0
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
Eraser.DefaultPlugins/FileSystems/Ntfs.cs (modified) (5 diffs)
-
Eraser.Manager/DirectExecutor.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/6.0
- Property svn:mergeinfo changed
/trunk/eraser6 merged: 1438-1440
- Property svn:mergeinfo changed
-
branches/eraser6/6.0/Eraser.DefaultPlugins/FileSystems/Ntfs.cs
r1360 r1441 70 70 PrngManager.GetInstance(ManagerLibrary.Settings.ActivePrng), 71 71 null); 72 73 //Call the callback function if one is provided. We'll provide a dummy 74 //value since we really have no idea how much of the MFT we can clean. 75 if (callback != null) 76 callback(0, 1); 72 77 } 73 78 } … … 86 91 catch (IOException) 87 92 { 88 //OK, enough squeezing .93 //OK, enough squeezing: there isn't enough space to even create a new MFT record. 89 94 } 90 95 } … … 103 108 long mftSize = NtfsApi.GetMftValidSize(info); 104 109 long mftRecordSegmentSize = NtfsApi.GetMftRecordSegmentSize(info); 105 int pollingInterval = (int)Math.Max(1, (mftSize / info.ClusterSize / 20)); 106 int totalFiles = (int)Math.Max(1L, mftSize / mftRecordSegmentSize) * 107 (FileNameErasePasses + 1); 110 int pollingInterval = (int)Math.Min(Math.Max(1, mftSize / info.ClusterSize / 20), 128); 111 int totalFiles = (int)Math.Max(1L, mftSize / mftRecordSegmentSize); 108 112 int filesCreated = 0; 109 113 … … 118 122 if (filesCreated % pollingInterval == 0) 119 123 { 124 //Call back to our progress function: this is the first half of the 125 //procedure so divide the effective progress by 2. 120 126 if (callback != null) 121 callback(filesCreated, totalFiles); 127 { 128 int halfFilesCreated = filesCreated / 2; 129 callback(halfFilesCreated, Math.Min(halfFilesCreated, totalFiles)); 130 } 122 131 123 132 //Check if the MFT has grown. … … 134 143 //Clear up all the temporary files 135 144 FileInfo[] files = tempDir.GetFiles("*", SearchOption.AllDirectories); 136 int totalFiles = files.Length * (FileNameErasePasses + 1);137 145 for (int i = 0; i < files.Length; ++i) 138 146 { 139 147 if (callback != null && i % 50 == 0) 140 callback(files.Length + i * FileNameErasePasses, totalFiles);148 callback(files.Length + i, files.Length * 2); 141 149 DeleteFile(files[i]); 142 150 } -
branches/eraser6/6.0/Eraser.Manager/DirectExecutor.cs
r1360 r1441 638 638 progress.Event.CurrentItemName = S._("Old resident file system table files"); 639 639 task.OnProgressChanged(progress.Event); 640 fsManager.EraseOldFileSystemResidentFiles(volInfo, info, method, null); 640 ProgressManager residentFilesProgress = new ProgressManager(); 641 residentFilesProgress.Start(); 642 fsManager.EraseOldFileSystemResidentFiles(volInfo, info, method, 643 delegate(int currentFile, int totalFiles) 644 { 645 residentFilesProgress.Completed = currentFile; 646 residentFilesProgress.Total = totalFiles; 647 progress.Event.CurrentItemProgress = residentFilesProgress.Progress; 648 progress.Event.TimeLeft = residentFilesProgress.TimeLeft; 649 task.OnProgressChanged(progress.Event); 650 651 if (currentTask.Canceled) 652 throw new OperationCanceledException(S._("The task was cancelled.")); 653 } 654 ); 641 655 } 642 656 finally
Note: See TracChangeset
for help on using the changeset viewer.
