Changeset 2251


Ignore:
Timestamp:
10/23/2010 4:18:25 PM (4 years ago)
Author:
lowjoel
Message:

Supplements r2249: compile fixes and remove redundant code in the v6.0 branch (some changes were specific to 6.2)

Location:
branches/eraser6/6.0
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/6.0/Eraser.DefaultPlugins/FileSystems/Windows.cs

    r2249 r2251  
    3636    public abstract class WindowsFileSystem : FileSystem 
    3737    { 
    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  
    4438        public override void DeleteFile(FileInfo info) 
    4539        { 
     
    5751                try 
    5852                { 
    59                     ResetFileTimes(info); 
     53                    info.CreationTime = info.LastWriteTime = info.LastAccessTime = MinTimestamp; 
    6054                    info.MoveTo(newPath); 
    6155                    ++i; 
     
    8175                            break; 
    8276 
    83                         case Win32ErrorCode.DiskFull: 
     77                        case 112: //ERROR_DISK_FULL 
    8478                            //If the disk is full, we can't do anything except manually deleting 
    8579                            //the file, break out of this loop. 
     
    373367                } 
    374368            } 
    375             finally 
    376             { 
    377                 //Reset the file times 
    378                 streamInfo.SetTimes(MinTimestamp, created, lastWrite, lastAccess); 
    379             } 
    380369        } 
    381370 
  • branches/eraser6/6.0/Eraser.Util/KernelApi.cs

    r1695 r2251  
    612612                uint dwFlagsAndAttributes, IntPtr hTemplateFile); 
    613613 
     614            public const uint FILE_READ_ATTRIBUTES = 0x0080; 
     615            public const uint FILE_WRITE_ATTRIBUTES = 0x0100; 
    614616            public const uint GENERIC_READ = 0x80000000; 
    615617            public const uint GENERIC_WRITE = 0x40000000; 
  • branches/eraser6/6.0/Eraser.Util/StreamInfo.cs

    r2249 r2251  
    387387            } 
    388388 
    389             return OpenHandle(mode, iAccess, share, options); 
    390         } 
    391  
    392         internal SafeFileHandle OpenHandle(FileMode mode, uint access, FileShare share, 
    393             FileOptions options) 
    394         { 
    395389            //Sharing mode 
    396390            if ((share & FileShare.Inheritable) != 0) 
     
    414408        } 
    415409 
    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  
    428410        /// <summary> 
    429411        /// Returns the path as a string. 
Note: See TracChangeset for help on using the changeset viewer.