Changeset 2251
- Timestamp:
- 10/23/2010 4:18:25 PM (3 years ago)
- Location:
- branches/eraser6/6.0
- Files:
-
- 3 edited
-
Eraser.DefaultPlugins/FileSystems/Windows.cs (modified) (4 diffs)
-
Eraser.Util/KernelApi.cs (modified) (1 diff)
-
Eraser.Util/StreamInfo.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/6.0/Eraser.DefaultPlugins/FileSystems/Windows.cs
r2249 r2251 36 36 public abstract class WindowsFileSystem : FileSystem 37 37 { 38 public override void ResetFileTimes(FileSystemInfo info)39 {40 //Reset the file access times: after every rename the file times may change.41 info.SetTimes(MinTimestamp, MinTimestamp, MinTimestamp, MinTimestamp);42 }43 44 38 public override void DeleteFile(FileInfo info) 45 39 { … … 57 51 try 58 52 { 59 ResetFileTimes(info);53 info.CreationTime = info.LastWriteTime = info.LastAccessTime = MinTimestamp; 60 54 info.MoveTo(newPath); 61 55 ++i; … … 81 75 break; 82 76 83 case Win32ErrorCode.DiskFull:77 case 112: //ERROR_DISK_FULL 84 78 //If the disk is full, we can't do anything except manually deleting 85 79 //the file, break out of this loop. … … 373 367 } 374 368 } 375 finally376 {377 //Reset the file times378 streamInfo.SetTimes(MinTimestamp, created, lastWrite, lastAccess);379 }380 369 } 381 370 -
branches/eraser6/6.0/Eraser.Util/KernelApi.cs
r1695 r2251 612 612 uint dwFlagsAndAttributes, IntPtr hTemplateFile); 613 613 614 public const uint FILE_READ_ATTRIBUTES = 0x0080; 615 public const uint FILE_WRITE_ATTRIBUTES = 0x0100; 614 616 public const uint GENERIC_READ = 0x80000000; 615 617 public const uint GENERIC_WRITE = 0x40000000; -
branches/eraser6/6.0/Eraser.Util/StreamInfo.cs
r2249 r2251 387 387 } 388 388 389 return OpenHandle(mode, iAccess, share, options);390 }391 392 internal SafeFileHandle OpenHandle(FileMode mode, uint access, FileShare share,393 FileOptions options)394 {395 389 //Sharing mode 396 390 if ((share & FileShare.Inheritable) != 0) … … 414 408 } 415 409 416 public void SetTimes(DateTime updateTime, DateTime createdTime, DateTime lastModifiedTime,417 DateTime lastAccessedTime)418 {419 using (SafeFileHandle streamHandle = OpenHandle(FileMode.Open,420 NativeMethods.FILE_WRITE_ATTRIBUTES, FileShare.ReadWrite,421 FileOptions.None))422 {423 ExtensionMethods.IO.SetTimes(streamHandle, updateTime, createdTime,424 lastModifiedTime, lastAccessedTime);425 }426 }427 428 410 /// <summary> 429 411 /// Returns the path as a string.
Note: See TracChangeset
for help on using the changeset viewer.
