internal static Stream OpenAsyncRead(string fullPath) { Debug.Assert(PathUtilities.IsAbsolute(fullPath)); return(RethrowExceptionsAsIOException(() => new FileStream(fullPath, FileMode.Open, FileAccess.Read, FileShare.Read, 4096, FileOptions.Asynchronous))); }
internal static string ResolveRelativePath(string path, string basePath, string baseDirectory) { Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); return(ResolveRelativePath(PathUtilities.GetPathKind(path), path, basePath, baseDirectory)); }
/// <summary> /// Normalizes an absolute path. /// </summary> /// <param name="path">Path to normalize.</param> /// <exception cref="ArgumentException"/> /// <exception cref="System.Security.SecurityException"/> /// <exception cref="ArgumentNullException"/> /// <exception cref="NotSupportedException"/> /// <exception cref="PathTooLongException"/> /// <returns>Normalized path.</returns> internal static string NormalizeAbsolutePath(string path) { // we can only call GetFullPath on an absolute path to avoid dependency on process state (current directory): Debug.Assert(PathUtilities.IsAbsolute(path)); return(Path.GetFullPath(path)); }