Table of Contents

Class PathExtensions

Namespace
Olve.Paths
Assembly
Olve.Paths.dll

Extension methods for IPath and IPurePath.

public static class PathExtensions
Inheritance
PathExtensions
Inherited Members

Methods

EnsurePathExists(IPath)

Ensures the directory at the given path exists, creating it if necessary.

public static bool EnsurePathExists(this IPath path)

Parameters

path IPath

The path to ensure exists as a directory.

Returns

bool

true if the directory was created; false if it already existed.

IsWithin(IPurePath, IPurePath)

Determines whether path is root or lies inside it, after evaluating . and .. on both. The check is lexical: symbolic links are not resolved. Paths on different platforms, or an absolute and a non-absolute path, are never within each other.

public static bool IsWithin(this IPurePath path, IPurePath root)

Parameters

path IPurePath

The path to check.

root IPurePath

The directory it must stay within.

Returns

bool

true if path is within root.