Ignore:
Timestamp:
6/18/2010 2:36:03 PM (2 years ago)
Author:
lowjoel
Message:
  • Define a VolumeStream? class which is a FileStream? customised for raw volume access. This results in the VolumeLock? class being merged into the VolumeStream? class, automatically handling locking and unlocking of volumes.
  • Change all internal OpenHandle? functions to private, since they should not be callable from outside the class.
  • Perform error checking in OpenHandle? so that even callers of OpenHandle? gets error checking.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.DefaultPlugins/FileSystems/Fat.cs

    r2157 r2189  
    8989                try 
    9090                { 
    91                     using (VolumeLock volumeLock = info.LockVolume(stream)) 
     91                    while (eraseQueue.Count != 0) 
    9292                    { 
    93                         while (eraseQueue.Count != 0) 
    94                         { 
    95                             if (callback != null) 
    96                                 callback(directoriesCleaned, directoriesCleaned + eraseQueue.Count); 
     93                        if (callback != null) 
     94                            callback(directoriesCleaned, directoriesCleaned + eraseQueue.Count); 
    9795 
    98                             FatDirectoryBase currentDir = api.LoadDirectory(eraseQueue[0].FullName); 
    99                             eraseQueue.RemoveAt(0); 
     96                        FatDirectoryBase currentDir = api.LoadDirectory(eraseQueue[0].FullName); 
     97                        eraseQueue.RemoveAt(0); 
    10098 
    101                             //Queue the subfolders in this directory 
    102                             foreach (KeyValuePair<string, FatDirectoryEntry> entry in currentDir.Items) 
    103                                 if (entry.Value.EntryType == FatDirectoryEntryType.Directory) 
    104                                 { 
    105                                     //Check that we don't have the same cluster queued twice (e.g. for 
    106                                     //long/8.3 file names) 
    107                                     if (eraseQueueClusters.Contains(entry.Value.Cluster)) 
    108                                         continue; 
     99                        //Queue the subfolders in this directory 
     100                        foreach (KeyValuePair<string, FatDirectoryEntry> entry in currentDir.Items) 
     101                            if (entry.Value.EntryType == FatDirectoryEntryType.Directory) 
     102                            { 
     103                                //Check that we don't have the same cluster queued twice (e.g. for 
     104                                //long/8.3 file names) 
     105                                if (eraseQueueClusters.Contains(entry.Value.Cluster)) 
     106                                    continue; 
    109107 
    110                                     eraseQueueClusters.Add(entry.Value.Cluster); 
    111                                     eraseQueue.Add(entry.Value); 
    112                                 } 
     108                                eraseQueueClusters.Add(entry.Value.Cluster); 
     109                                eraseQueue.Add(entry.Value); 
     110                            } 
    113111 
    114                             currentDir.ClearDeletedEntries(); 
    115                             ++directoriesCleaned; 
    116                         } 
     112                        currentDir.ClearDeletedEntries(); 
     113                        ++directoriesCleaned; 
    117114                    } 
    118115                } 
Note: See TracChangeset for help on using the changeset viewer.