## os.path -- abstract file path handling ### Index namespace [os](#os) class [Path](#path) - [.path](#path_prop)() => string - [.kind](#kind)() => enum<win,unix> - [.root](#root)() => string - [.name](#name)() => string - [check](#check)(_what_: enum<absolute,canonical>) => bool - [.suffix](#suffix)() => string - [.basename](#basename)() => string - [join](#join)(_other_: Path) => Path - [join](#join)(_other_: string) => Path - static [/](#join)(_a_: Path, _b_: Path) => Path - static [/](#join)(_a_: Path, _b_: string) => Path - [split](#split)() => list<string> - [normalize](#normalize)() => Path - static [==](#cmp)(_a_: Path, _b_: Path) => bool - static [!=](#cmp)(_a_: Path, _b_: Path) => bool - [(string)](#string)(_hashing_ = false) - [relativeTo](#relativeto)(_base_: Path) => Path - [relativeTo](#relativeto)(_base_: string) => Path - [[]](#relativeto)(_target_: Path) => Path - [[]](#relativeto)(_target_: string) => Path - [clone](#clone)() => Path Functions: - [path](#newpath)(_kind_: enum<win,unix>, _value_: string) => Path - [path](#newpath)(_value_: string) => Path ### Classes ####`os::Path` Abstract file system path #### Methods ```ruby .path() => string ``` Path string ```ruby .kind() => enum ``` Path kind (Windows or Unix) ```ruby .root() => string ``` Root, if present ```ruby .name() => string ``` Final path component ```ruby check(what: enum) => bool ``` Checks if path is absolute or canonical, depending on *what* ```ruby .suffix() => string ``` Path name suffix ```ruby .basename() => string ``` Name without suffix ```ruby join(other: Path) => Path join(other: string) => Path static /(a: Path, b: Path) => Path static /(a: Path, b: string) => Path ``` Joins two paths and returns the resulting path **Errors:** `Param` if joining paths of different kinds, `Path` when appending an absolute path ```ruby split() => list ``` Splits path into individual components ```ruby normalize() => Path ``` Normalizes path by removing '.', '..' and multiple consecutive path separators **Errors:** `Path` if backtracking with '..' exceeded path boundaries ```ruby static ==(a: Path, b: Path) => bool static !=(a: Path, b: Path) => bool ``` Compares *a* and *b* component-wise ```ruby (string)(hashing = false) ``` Conversion to string ```ruby relativeTo(base: Path) => Path relativeTo(base: string) => Path [](target: Path) => Path [](target: string) => Path ``` Returns relative path from *base* path to this path or from this path to *target* path ```ruby clone() => Path ``` Returns path copy ### Functions ```ruby path(kind: enum, value: string) => Path path(value: string) => Path ``` Constructs path object with the given *value* and *kind* (system-dependent if omitted) **Errors:**: `Path` for empty on invalid path