Changeset 2093 for trunk/eraser
- Timestamp:
- 05/10/10 12:06:58 (3 years ago)
- Location:
- trunk/eraser
- Files:
-
- 3 edited
-
Eraser.Manager/FileSystem.cs (modified) (1 diff)
-
Eraser/Program.cs (modified) (1 diff)
-
Eraser/SchedulerPanel.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser/Eraser.Manager/FileSystem.cs
r1884 r2093 141 141 "replaced with random data.")); 142 142 143 //Get an item from the list of files, and then check that the item exists. 143 144 int index = prng.Next(entries.Count - 1); 144 if ((File.GetAttributes(entries[index]) & FileAttributes.Directory) != 0) 145 shadowFile = entries[index]; 146 if (File.Exists(shadowFile)) 145 147 { 146 DirectoryInfo dir = new DirectoryInfo(entries[index]); 147 FileInfo[] files = dir.GetFiles("*", SearchOption.AllDirectories); 148 foreach (FileInfo f in files) 149 entries.Add(f.FullName); 148 if ((File.GetAttributes(shadowFile) & FileAttributes.Directory) != 0) 149 { 150 DirectoryInfo dir = new DirectoryInfo(shadowFile); 151 FileInfo[] files = dir.GetFiles("*", SearchOption.AllDirectories); 152 entries.Capacity += files.Length; 153 foreach (FileInfo f in files) 154 entries.Add(f.FullName); 155 } 156 else 157 shadowFile = entries[index]; 150 158 } 151 159 else 152 shadowFile = entries[index];160 shadowFile = null; 153 161 154 162 entries.RemoveAt(index); 155 163 } 156 while (s hadowFile == null || shadowFile.Length == 0 || !File.Exists(shadowFile));164 while (string.IsNullOrEmpty(shadowFile)); 157 165 shadowFileInfo = new FileInfo(shadowFile); 158 166 } -
trunk/eraser/Eraser/Program.cs
r2064 r2093 489 489 foreach (string path in args.PositionalArguments) 490 490 { 491 //If the path doesn't exist, skip the file 492 if (!File.Exists(path)) 493 continue; 494 491 495 FileSystemObjectErasureTarget target = null; 492 496 if ((File.GetAttributes(path) & FileAttributes.Directory) != 0) -
trunk/eraser/Eraser/SchedulerPanel.cs
r2059 r2093 534 534 if (files != null) 535 535 foreach (string file in files) 536 { 536 { 537 //If the path doesn't exist, skip the file 538 if (!File.Exists(file)) 539 continue; 540 537 541 FileSystemObjectErasureTarget target; 538 542 if ((File.GetAttributes(file) & FileAttributes.Directory) != 0)
Note: See TracChangeset
for help on using the changeset viewer.
