Changeset 2155 for trunk/eraser/Eraser.Util/StreamInfo.cs
- Timestamp:
- 6/13/2010 12:29:44 AM (2 years ago)
- File:
-
- 1 edited
-
trunk/eraser/Eraser.Util/StreamInfo.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser/Eraser.Util/StreamInfo.cs
r2134 r2155 310 310 } 311 311 312 return OpenHandle(mode, iAccess, share, options); 313 } 314 315 internal SafeFileHandle OpenHandle(FileMode mode, uint access, FileShare share, 316 FileOptions options) 317 { 312 318 //Sharing mode 313 319 if ((share & FileShare.Inheritable) != 0) … … 319 325 320 326 //Create the handle 321 SafeFileHandle result = NativeMethods.CreateFile(FullName, iAccess,327 SafeFileHandle result = NativeMethods.CreateFile(FullName, access, 322 328 (uint)share, IntPtr.Zero, (uint)mode, (uint)options, IntPtr.Zero); 323 329 if (result.IsInvalid) … … 331 337 } 332 338 339 public void SetTimes(DateTime updateTime, DateTime createdTime, DateTime lastModifiedTime, 340 DateTime lastAccessedTime) 341 { 342 using (SafeFileHandle streamHandle = OpenHandle(FileMode.Open, 343 NativeMethods.FILE_WRITE_ATTRIBUTES, FileShare.ReadWrite, 344 FileOptions.None)) 345 { 346 ExtensionMethods.IO.SetTimes(streamHandle, updateTime, createdTime, 347 lastModifiedTime, lastAccessedTime); 348 } 349 } 350 333 351 /// <summary> 334 352 /// Returns the path as a string.
Note: See TracChangeset
for help on using the changeset viewer.
