/// <summary> /// Whether the status is one that should be treated as a nonexistent file /// </summary> /// <remarks> /// Keep this in sync with IsHresultNonesixtent(int) inside of <see cref="BuildXL.Native.IO.Windows.FileSystemWin"/> /// </remarks> public static bool IsNonexistent(this OpenFileStatus status) { return(status == OpenFileStatus.FileNotFound || status == OpenFileStatus.PathNotFound || status == OpenFileStatus.ErrorNotReady || status == OpenFileStatus.FveLockedVolume); }
/// <summary> /// Creates an <see cref="OpenFileResult"/> without any normalization from native error code. /// </summary> private OpenFileResult(string path, OpenFileStatus status, int nativeErrorCode, bool openedOrTruncatedExistingFile) { Path = path; Status = status; NativeErrorCode = nativeErrorCode; OpenedOrTruncatedExistingFile = openedOrTruncatedExistingFile; }
/// <summary> /// Whether the status is one that implies other process blocking the handle. /// </summary> public static bool ImpliesOtherProcessBlockingHandle(this OpenFileStatus status) { return(status == OpenFileStatus.SharingViolation || status == OpenFileStatus.AccessDenied); }
/// <summary> /// Creates an <see cref="OpenFileResult"/> without any normalization from native error code. /// </summary> public OpenFileResult(OpenFileStatus status, int nativeErrorCode, bool openedOrTruncatedExistingFile) { Status = status; NativeErrorCode = nativeErrorCode; OpenedOrTruncatedExistingFile = openedOrTruncatedExistingFile; }