Changeset 1140


Ignore:
Timestamp:
6/19/2009 2:49:29 AM (6 years ago)
Author:
lowjoel
Message:

Clean up files meant for cleaning up the MFT after we are done with it. Thanks to mcmaster76 for reporting the bug.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser.Manager/FileSystem.cs

    r1094 r1140  
    356356            ErasureMethod method, FileSystemEntriesEraseProgress callback) 
    357357        { 
     358            DirectoryInfo rootDir = new DirectoryInfo(FileSystem.GenerateRandomFileName( 
     359                new DirectoryInfo(volume.MountPoints[0]), 32)); 
     360            rootDir.Create(); 
     361 
    358362            try 
    359363            { 
    360364                //Squeeze one-byte files until the volume or the MFT is full. 
    361                 DirectoryInfo rootDir = new DirectoryInfo(info.MountPoints[0]); 
    362                 long oldMFTSize = NtfsApi.GetMftValidSize(info); 
     365                long oldMFTSize = NtfsApi.GetMftValidSize(volume); 
    363366 
    364367                for ( ; ; ) 
     
    387390                //OK, enough squeezing. 
    388391            } 
     392            finally 
     393            { 
     394                rootDir.Delete(true); 
     395            } 
    389396        } 
    390397 
     
    393400        { 
    394401            //Create a directory to hold all the temporary files 
    395             DirectoryInfo tempDir = new DirectoryInfo(info.MountPoints[0]); 
    396             tempDir = new DirectoryInfo(FileSystem.GenerateRandomFileName(tempDir, 32)); 
     402            DirectoryInfo tempDir = new DirectoryInfo(FileSystem.GenerateRandomFileName( 
     403                new DirectoryInfo(info.MountPoints[0]), 32)); 
    397404            tempDir.Create(); 
    398405 
Note: See TracChangeset for help on using the changeset viewer.