OxL Reference

method Path.parent

Everything before the last component (a/b/c -> a/b, a -> empty, /a -> /), none for / and the empty path.

Example:

oxl✓ checked in CI
use std.io { Path }

fn main() io {
  print(Path.of("/src/main.oxl").parent()!.text)
}
Output
/src
pub(api) fn parent() -> Path?

Since. 1.0.0-beta

Returns

Path?

Effects

none declared (pure unless the body says otherwise)

Defined in: std/io/io.oxl:915

See also