/// <summary> /// Returns the <see cref="SafeFileHandle" /> and fills <see cref="Win32FindData" /> from the passes path. /// </summary> /// <param name="path">Path to the file system entry</param> /// <returns> /// <see cref="SafeFileHandle" /> /// </returns> internal static SafeFileHandle OpenReadWriteFileSystemEntryHandle(string path) { return(Win32SafeNativeMethods.OpenReadWriteFileSystemEntryHandle(path, (0x40000000 | 0x80000000), FileShare.Read | FileShare.Write | FileShare.Delete, IntPtr.Zero, FileMode.Open, (0x02000000), IntPtr.Zero)); }
/// <summary> /// Reurns true if passed path exists /// </summary> /// <param name="pathInfo">Path to check</param> public static Boolean Exists(PathInfo pathInfo) { uint attributes = Win32SafeNativeMethods.GetFileAttributes(pathInfo.FullNameUnc); return(!Equals(attributes, 0xffffffff)); }